mirror of
https://github.com/postgres/postgres.git
synced 2025-10-25 13:17:41 +03:00
were accepted by prior Postgres releases. This takes care of the loose end left by the preceding patch to downgrade implicit casts-to-text. To avoid breaking desirable behavior for array concatenation, introduce a new polymorphic pseudo-type "anynonarray" --- the added concatenation operators are actually text || anynonarray and anynonarray || text.
31 lines
735 B
SQL
31 lines
735 B
SQL
--
|
|
-- TEXT
|
|
--
|
|
|
|
SELECT text 'this is a text string' = text 'this is a text string' AS true;
|
|
|
|
SELECT text 'this is a text string' = text 'this is a text strin' AS false;
|
|
|
|
CREATE TABLE TEXT_TBL (f1 text);
|
|
|
|
INSERT INTO TEXT_TBL VALUES ('doh!');
|
|
INSERT INTO TEXT_TBL VALUES ('hi de ho neighbor');
|
|
|
|
SELECT '' AS two, * FROM TEXT_TBL;
|
|
|
|
-- As of 8.3 we have removed most implicit casts to text, so that for example
|
|
-- this no longer works:
|
|
|
|
select length(42);
|
|
|
|
-- But as a special exception for usability's sake, we still allow implicit
|
|
-- casting to text in concatenations, so long as the other input is text or
|
|
-- an unknown literal. So these work:
|
|
|
|
select 'four: '::text || 2+2;
|
|
select 'four: ' || 2+2;
|
|
|
|
-- but not this:
|
|
|
|
select 3 || 4.0;
|