Re: PL/pgSQL 1.2

From: Marko Tiikkaja <marko(at)joh(dot)to>
To: Shaun Thomas <sthomas(at)optionshouse(dot)com>, Hannu Krosing <hannu(at)2ndQuadrant(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Joel Jacobson <joel(at)trustly(dot)com>, Josh Berkus <josh(at)agliodbs(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PL/pgSQL 1.2
Date: 2014-09-04 14:12:48
Message-ID: 54087360.90507@joh.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2014-09-04 14:14:22 Re: Scaling shared buffer eviction
Previous Message Shaun Thomas 2014-09-04 14:09:17 Re: PL/pgSQL 1.2