Re: PL/pgSQL 1.2 - Mailing list pgsql-hackers

From Marko Tiikkaja
Subject Re: PL/pgSQL 1.2
Date
Msg-id 54087360.90507@joh.to
Whole thread Raw
In response to Re: PL/pgSQL 1.2  (Shaun Thomas <sthomas@optionshouse.com>)
List 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 by date:

Previous
From: Shaun Thomas
Date:
Subject: Re: PL/pgSQL 1.2
Next
From: Kevin Grittner
Date:
Subject: Re: Scaling shared buffer eviction