Re: PL/pgSQL 2
От | Kevin Grittner |
---|---|
Тема | Re: PL/pgSQL 2 |
Дата | |
Msg-id | 1409674147.64617.YahooMailNeo@web122304.mail.ne1.yahoo.com обсуждение исходный текст |
Ответ на | Re: PL/pgSQL 2 (Joel Jacobson <joel@trustly.com>) |
Ответы |
Re: PL/pgSQL 2
|
Список | pgsql-hackers |
Joel Jacobson <joel@trustly.com> wrote: > The common use-case I have in mind is when you have a function which > takes some kind of ID as an input param, which maps to a primary key > in some table, which you want to update. > If the where-clause would be incorrect and the update would update all > rows in the table, that would be a disaster, which is what I want to > prevent. Joel Jacobson <joel@trustly.com> wrote: > Sorry for being unclear, I didn't mean to suggest the main concern is > updating *all* rows. > The main concern is when you have a rather complex UPDATE WHERE clause, > aiming to update exactly one row. Some of the expressions might be > assertions, to just double-verify the values and to make it stand-out > you are checking those expressions. These are two different problems which probably need two different solutions. Making the default behavior of a set-based command that it throw an error if the resulting set is not exactly one row doesn't seem like the right solution to either one of them. -- Kevin Grittner EDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
В списке pgsql-hackers по дате отправления: