Re: [HACKERS] issue: record or row variable cannot be part of multiple-item INTO list
| От | Tom Lane |
|---|---|
| Тема | Re: [HACKERS] issue: record or row variable cannot be part of multiple-item INTO list |
| Дата | |
| Msg-id | 19190.1494706804@sss.pgh.pa.us обсуждение |
| Ответ на | [HACKERS] issue: record or row variable cannot be part of multiple-item INTO list (Pavel Stehule <pavel.stehule@gmail.com>) |
| Ответы |
Re: [HACKERS] issue: record or row variable cannot be part ofmultiple-item INTO list
Re: [HACKERS] issue: record or row variable cannot be part ofmultiple-item INTO list |
| Список | pgsql-hackers |
Pavel Stehule <pavel.stehule@gmail.com> writes:
> I am working on migration large Oracle application to Postgres. When I
> started migration procedures with OUT parameters I found following limit
> "record or row variable cannot be part of multiple-item INTO list"
IIRC, the reason for disallowing that is that it's totally unclear what
the semantics ought to be. Is that variable a single target (demanding
a compatible composite-valued column from the source query), or does it
eat one source column per field within the record/row? The former is 100%
inconsistent with what happens if the record/row is the only INTO target;
while the latter would be very bug-prone, and it's especially unclear what
ought to happen if it's an as-yet-undefined record variable.
Yeah, we could invent some semantics or other, but I think it would
mostly be a foot-gun for unwary programmers.
We do allow you to write out the columns individually for such cases:
SELECT ... INTO v1, rowvar.c1, rowvar.c2, rowvar.c3, v2 ...
and I think it's better to encourage people to stick to that.
regards, tom lane
В списке pgsql-hackers по дате отправления: