On 9/2/14 6:03 PM, Heikki Linnakangas wrote:
Marko posted a patch to add assertions to PL/pgSQL last year, see http://www.postgresql.org/message-id/[email protected]. It was a long thread, but in the end I think everyone was more or less OK with the syntax "ASSERT <condition>;". I also think that syntax is fine, and it would be a nice feature, assuming we can avoid reserving the ASSERT keyword.
Did you really mean to say "more or less OK"? I didn't wade through the thread, but my recollection is that I was the only one truly OK with it, some people expressed concerns but appeared undecided, and the rest of the participants were completely against it.
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.
I agree with Joel here; I think a shorter syntax is necessary. .marko -- Sent via pgsql-hackers mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
