Re: PL/pgSQL 1.2

Поиск
Список
Период
Сортировка
От Marko Tiikkaja
Тема Re: PL/pgSQL 1.2
Дата
Msg-id 54087360.90507@joh.to
обсуждение исходный текст
Ответ на Re: PL/pgSQL 1.2  (Shaun Thomas <sthomas@optionshouse.com>)
Список pgsql-hackers
On 9/4/14 4:09 PM, Shaun Thomas wrote:
> On 09/03/2014 04:19 PM, Hannu Krosing wrote:
>
>> 1. Conditions for number of rows returned by SELECT or touched by
>> UPDATE or DELETE
>
> Now that I think upon this... don't we already have it?
>
> SELECT ... LIMIT 1

No, that just hides any bugs.  We want the opposite: any bugs or 
problems should be obvious.  If the query returns or touches more than 
one row, that should raise an error, not just give you a random one and 
call it a day.

> That already solves the purported problem of multiple results in SELECT
> INTO as well. Could we possibly extend that to UPDATE and DELETE syntax too?

Again, this is a different problem, but LIMIT syntax for UPDATE and 
DELETE has been proposed, see: 
http://www.postgresql.org/message-id/CADB9FDf-Vh6RnKAMZ4Rrg_YP9p3THdPbji8qe4qkxRuiOwm=mg@mail.gmail.com


.marko



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

Предыдущее
От: Shaun Thomas
Дата:
Сообщение: Re: PL/pgSQL 1.2
Следующее
От: Kevin Grittner
Дата:
Сообщение: Re: Scaling shared buffer eviction