Re: PL/PgSQL STRICT

Pavel Stehule <pavel.stehule@gmail.com>

From: Pavel Stehule <pavel.stehule@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Christopher Browne <cbbrowne@gmail.com>, Marko Tiikkaja <pgmail@joh.to>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2012-12-21T16:56:13Z
Lists: pgsql-hackers
2012/12/21 Tom Lane <tgl@sss.pgh.pa.us>:
> Christopher Browne <cbbrowne@gmail.com> writes:
>> This is adding specific syntax for what seems like an unusual case to me,
>> which seems like an unworthwhile complication.
>
> That was my first reaction too, but Marko's followon examples seem to
> make a reasonable case for it.  There are many situations where you
> expect an UPDATE or DELETE to hit exactly one row.  Often, programmers
> won't bother to add code to check that it did ... but if a one-word
> addition to the command can provide such a check, it seems more likely
> that they would add the check.

and it can be used for optimization - it can be optimized for fast first row

Regards

Pavel

>
>                         regards, tom lane
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers