mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-12 04:26:59 +02:00
f5ab0a14ea
in UPDATE. We also now issue a NOTICE if a query has _any_ implicit range table entries -- in the past, we would only warn about implicit RTEs in SELECTs with at least one explicit RTE. As a result of the warning change, 25 of the regression tests had to be updated. I also took the opportunity to remove some bogus whitespace differences between some of the float4 and float8 variants. I believe I have correctly updated all the platform-specific variants, but let me know if that's not the case. Original patch for DELETE ... USING from Euler Taveira de Oliveira, reworked by Neil Conway.
76 lines
1.4 KiB
SQL
76 lines
1.4 KiB
SQL
--
|
|
-- CHAR
|
|
--
|
|
|
|
-- fixed-length by value
|
|
-- internally passed by value if <= 4 bytes in storage
|
|
|
|
SELECT char 'c' = char 'c' AS true;
|
|
|
|
--
|
|
-- Build a table for testing
|
|
--
|
|
|
|
CREATE TABLE CHAR_TBL(f1 char);
|
|
|
|
INSERT INTO CHAR_TBL (f1) VALUES ('a');
|
|
|
|
INSERT INTO CHAR_TBL (f1) VALUES ('A');
|
|
|
|
-- any of the following three input formats are acceptable
|
|
INSERT INTO CHAR_TBL (f1) VALUES ('1');
|
|
|
|
INSERT INTO CHAR_TBL (f1) VALUES (2);
|
|
|
|
INSERT INTO CHAR_TBL (f1) VALUES ('3');
|
|
|
|
-- zero-length char
|
|
INSERT INTO CHAR_TBL (f1) VALUES ('');
|
|
|
|
-- try char's of greater than 1 length
|
|
INSERT INTO CHAR_TBL (f1) VALUES ('cd');
|
|
INSERT INTO CHAR_TBL (f1) VALUES ('c ');
|
|
|
|
|
|
SELECT '' AS seven, * FROM CHAR_TBL;
|
|
|
|
SELECT '' AS six, c.*
|
|
FROM CHAR_TBL c
|
|
WHERE c.f1 <> 'a';
|
|
|
|
SELECT '' AS one, c.*
|
|
FROM CHAR_TBL c
|
|
WHERE c.f1 = 'a';
|
|
|
|
SELECT '' AS five, c.*
|
|
FROM CHAR_TBL c
|
|
WHERE c.f1 < 'a';
|
|
|
|
SELECT '' AS six, c.*
|
|
FROM CHAR_TBL c
|
|
WHERE c.f1 <= 'a';
|
|
|
|
SELECT '' AS one, c.*
|
|
FROM CHAR_TBL c
|
|
WHERE c.f1 > 'a';
|
|
|
|
SELECT '' AS two, c.*
|
|
FROM CHAR_TBL c
|
|
WHERE c.f1 >= 'a';
|
|
|
|
DROP TABLE CHAR_TBL;
|
|
|
|
--
|
|
-- Now test longer arrays of char
|
|
--
|
|
|
|
CREATE TABLE CHAR_TBL(f1 char(4));
|
|
|
|
INSERT INTO CHAR_TBL (f1) VALUES ('a');
|
|
INSERT INTO CHAR_TBL (f1) VALUES ('ab');
|
|
INSERT INTO CHAR_TBL (f1) VALUES ('abcd');
|
|
INSERT INTO CHAR_TBL (f1) VALUES ('abcde');
|
|
INSERT INTO CHAR_TBL (f1) VALUES ('abcd ');
|
|
|
|
SELECT '' AS four, * FROM CHAR_TBL;
|