Re: [PERFORM] typoed column name, but postgres didn't grump
От | Kevin Grittner |
---|---|
Тема | Re: [PERFORM] typoed column name, but postgres didn't grump |
Дата | |
Msg-id | 4CD29DC802000025000372A4@gw.wicourts.gov обсуждение исходный текст |
Ответ на | Re: [PERFORM] typoed column name, but postgres didn't grump (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-bugs |
Tom Lane <tgl@sss.pgh.pa.us> wrote: > What would be affected is something like > > select text((1,2)); > > which you'd now be forced to write as > > select (1,2)::text; > > (or you could use CAST notation; but not text(row) or row.text). Right. As far as I'm aware, there are currently four ways to spell "cast record to text": select cast((1,2) as text); select (1,2)::text; select text((1,2)); select ((1,2)).text; We would be disallowing the last two spellings. They aren't that reliable as casts anyway, since whether they are taken as a cast depends on the field names of the record. test=# create type x as (a int, b int, c text); CREATE TYPE test=# select cast((1,2,'three')::x as text); row ------------- (1,2,three) (1 row) test=# select (1,2,'three')::x::text; row ------------- (1,2,three) (1 row) test=# select text((1,2,'three')::x); text ------------- (1,2,three) (1 row) test=# select ((1,2,'three')::x).text; text ------------- (1,2,three) (1 row) test=# drop type x; DROP TYPE test=# create type x as (a int, b int, text text); CREATE TYPE test=# select cast((1,2,'three')::x as text); row ------------- (1,2,three) (1 row) test=# select (1,2,'three')::x::text; row ------------- (1,2,three) (1 row) test=# select text((1,2,'three')::x); text ------- three (1 row) test=# select ((1,2,'three')::x).text; text ------- three (1 row) So we would only be keeping cast syntax which can be counted on to retain cast semantics in the face of a column name change. -Kevin
В списке pgsql-bugs по дате отправления: