Re: PL/pgSQL 2

Поиск
Список
Период
Сортировка
От Joel Jacobson
Тема Re: PL/pgSQL 2
Дата
Msg-id CAASwCXc6kY9djLXbaxORKiVXuC5mOZxz8VrXkGKZhgVkSgOOMQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: PL/pgSQL 2  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Ответы Re: PL/pgSQL 2  (Andrew Dunstan <andrew@dunslane.net>)
Re: PL/pgSQL 2  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Список pgsql-hackers
On Tue, Sep 2, 2014 at 6:03 PM, Heikki Linnakangas
<hlinnakangas@vmware.com> wrote:
> I think that would actually be a good way to enforce the rule that an UPDATE
> only updates a single row. Just put a "ASSERT ROW_COUNT=1;" after the
> update.

So instead of one line of code, I would need to write two lines of
code at almost *all* places where a currently have an UPDATE. :-(
In that case, I think "RETURNING TRUE INTO STRICT _OK" is less ugly.

I think the problem with my perspective is my ambitions. I use
PL/pgSQL not as a secondary language, but it's my primary language for
developing applications.
For me, updating a row, is like setting a variable in a normal language.
No normal language would require two rows to set a variable.
It would be like having to do:  my $var = 10;  die unless $var == 10;
in Perl to set a variable.



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

Предыдущее
От: Álvaro Hernández Tortosa
Дата:
Сообщение: Re: PL/pgSQL 2
Следующее
От: Joel Jacobson
Дата:
Сообщение: Re: PL/pgSQL 2