Re: Record returning function accept not matched columns declaration
От | Tom Lane |
---|---|
Тема | Re: Record returning function accept not matched columns declaration |
Дата | |
Msg-id | 301471.1709755749@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: Record returning function accept not matched columns declaration ("David G. Johnston" <david.g.johnston@gmail.com>) |
Список | pgsql-bugs |
"David G. Johnston" <david.g.johnston@gmail.com> writes: > with a(b) as (values (row(1,2,3))) > select (a.b).* from a; > ERROR: record type has not been registered I looked into this case. The failure occurs when the parser tries to expand the ".*" notation into separate output columns, as required per SQL spec. All it has is a Var of type RECORD referencing the VALUES RTE entry, so it has to fail. In the specific example given here, you could imagine drilling down into the VALUES and figuring out what concrete rowtype the RECORD value will have at runtime, but I'm not excited about going there. There are too many cases where it wouldn't work. Note that as long as you don't need parse-time expansion of the record, it works: =# with a(b) as (values (row(1,2,3))) select a.b from a; b --------- (1,2,3) (1 row) I pushed the patch for the original problem. After debating with myself I concluded that back-patching it was probably less risky than not back-patching, so I did that. regards, tom lane
В списке pgsql-bugs по дате отправления: