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 28032.1505848687@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] issue: record or row variable cannot be part ofmultiple-item INTO list  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: [HACKERS] issue: record or row variable cannot be part ofmultiple-item INTO list  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> I think the fact that single-target INTO lists and multiple-target
> INTO lists are handled completely differently is extremely poor
> language design.  It would have been far better, as you suggested
> downthread, to have added some syntax up front to let people select
> the behavior that they want, but I think there's little hope of
> changing this now without creating even more pain.

How so?  The proposal I gave is fully backwards-compatible.  It's
likely not the way we'd do it in a green field, but we don't have
a green field.

> I have a really hard time, however, imagining that anyone writes
> SELECT a, b, c, d, e, f, g, h, i, j, k INTO x, y, z and wants some of
> a-k to go into x, some more to go into y, and some more to go into z
> (and heaven help you if you drop a column from x or y -- now the whole
> semantics of the query change, yikes).  What's reasonable is to write
> SELECT a, b, c INTO x, y, z and have those correspond 1:1.

That's certainly a case that we ought to support somehow.  The problem is
staying reasonably consistent with the two-decades-old precedent of the
existing behavior for one target variable.
        regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] issue: record or row variable cannot be part of multiple-item INTO list
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: [HACKERS] PG 10 release notes