Re: plpgsql.consistent_into

Поиск
Список
Период
Сортировка
От Jim Nasby
Тема Re: plpgsql.consistent_into
Дата
Msg-id 52D482D4.2090902@nasby.net
обсуждение исходный текст
Ответ на Re: plpgsql.consistent_into  (Josh Berkus <josh@agliodbs.com>)
Ответы Re: plpgsql.consistent_into  (Florian Pflug <fgp@phlo.org>)
Список pgsql-hackers
On 1/13/14, 5:57 PM, Josh Berkus wrote:
> On 01/13/2014 03:41 PM, Florian Pflug wrote:
>> It therefor isn't an oversight that SELECT ... INTO allows multiple result rows
>> but INSERT/UPDATE/DELETE forbids them, it's been done that way on purpose and
>> for a reason. We shouldn't be second-guessing ourselves by changing that later -
>> not, at least, unless we have a *very* good reason for it. Which, AFAICS, we don't.
>>
>> (And yeah, personally I'd prefer if we'd complain about multiple rows. But it's
>> IMHO just too late for that)
>
> I *really* don't want to go through all my old code to find places where
> I used SELECT ... INTO just to pop off the first row, and ignored the
> rest.  I doubt anyone else does, either.

Do you regularly have use cases where you actually want just one RANDOM row? I suspect the far more likely scenario is
thatpeople write code assuming they'll get only one row and they'll end up with extremely hard to trace bugs if that
assumptionis ever wrong.
 
-- 
Jim C. Nasby, Data Architect                       jim@nasby.net
512.569.9461 (cell)                         http://jim.nasby.net



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

Предыдущее
От: "Erik Rijkers"
Дата:
Сообщение: Re: nested hstore patch
Следующее
От: Jim Nasby
Дата:
Сообщение: Re: plpgsql.consistent_into