Re: plpgsql.consistent_into

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: plpgsql.consistent_into
Дата
Msg-id 52D48DA1.8060107@agliodbs.com
обсуждение исходный текст
Ответ на plpgsql.consistent_into  (Marko Tiikkaja <marko@joh.to>)
Ответы Re: plpgsql.consistent_into  (Jim Nasby <jim@nasby.net>)
Список pgsql-hackers
On 01/13/2014 04:20 PM, Jim Nasby wrote:
> On 1/13/14, 5:57 PM, Josh Berkus wrote:
>> 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 that people write code
> assuming they'll get only one row and they'll end up with extremely hard
> to trace bugs if that assumption is ever wrong.

Regularly?  No.  But I've seen it, especially as part of a "does this
query return any rows?" test.  That's not the best way to test that, but
that doesn't stop a lot of people doing it.

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com



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

Предыдущее
От: Jan Kara
Дата:
Сообщение: Re: [Lsf-pc] Linux kernel impact on PostgreSQL performance
Следующее
От: Jim Nasby
Дата:
Сообщение: Re: plpgsql.consistent_into