Re: PL/PgSQL STRICT

Поиск
Список
Период
Сортировка
От Joel Jacobson
Тема Re: PL/PgSQL STRICT
Дата
Msg-id CAASwCXcAc17DeVoY5YbYspFOnWRUmRmTK3Z3OQF+5EBBFLNOAg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: PL/PgSQL STRICT  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Fri, Dec 21, 2012 at 4:53 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> 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.

Very true.

When I was a PL/PgSQL beginner a few years ago I did exactly that, I
didn't check if the update actually updated any row, I didn't know it
could fail, and felt extremely worried and stupid when I realised
this. I spent an entire day going through all functions fixing this
problem at all places. The fix was not beautiful and it bugged me
there was not a prettier way to fix it.



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

Предыдущее
От: Phil Sorber
Дата:
Сообщение: Re: [WIP] pg_ping utility
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Feature Request: pg_replication_master()