Re: [HACKERS] PL/pgSQL return value in after triggers

2012-03-28 Thread Robert Haas
On Sun, Jan 1, 2012 at 11:37 PM, Peter Eisentraut wrote: > One thing that I'm concerned about with this is that it treats a plain > RETURN in a BEFORE trigger as RETURN NULL, whereas arguably it should be > an error.  I haven't found a good way to handle that yet, but I'll keep > looking. I would

Re: [HACKERS] PL/pgSQL return value in after triggers

2012-01-23 Thread Pavel Stehule
Hello Peter I checked code, and I don't think so this is good. A design of optional NULL is going to inconsistent syntax. RETURN (OLD, NEW, NULL, /* nothing */) is not consistent But my main argument is not intuitive behave of BEFORE triggers after this change. When somebody write BEFORE trig

Re: [HACKERS] PL/pgSQL return value in after triggers

2012-01-01 Thread Pavel Stehule
2012/1/2 Peter Eisentraut : > On mån, 2011-02-28 at 19:07 +0200, Peter Eisentraut wrote: >> PL/pgSQL trigger functions currently require a value to be returned, >> even though that value is not used for anything in case of a trigger >> fired AFTER.  I was wondering if we could relax that.  It would

Re: [HACKERS] PL/pgSQL return value in after triggers

2012-01-01 Thread Peter Eisentraut
On mån, 2011-02-28 at 19:07 +0200, Peter Eisentraut wrote: > PL/pgSQL trigger functions currently require a value to be returned, > even though that value is not used for anything in case of a trigger > fired AFTER. I was wondering if we could relax that. It would make > things a bit more robust

Re: [HACKERS] PL/pgSQL return value in after triggers

2011-02-28 Thread Tom Lane
Peter Eisentraut writes: > PL/pgSQL trigger functions currently require a value to be returned, > even though that value is not used for anything in case of a trigger > fired AFTER. I was wondering if we could relax that. I got bit by that just a couple days ago --- I supposed that a trigger tha

Re: [HACKERS] PL/pgSQL return value in after triggers

2011-02-28 Thread Robert Haas
On Mon, Feb 28, 2011 at 12:07 PM, Peter Eisentraut wrote: > PL/pgSQL trigger functions currently require a value to be returned, > even though that value is not used for anything in case of a trigger > fired AFTER.  I was wondering if we could relax that.  It would make > things a bit more robust

[HACKERS] PL/pgSQL return value in after triggers

2011-02-28 Thread Peter Eisentraut
PL/pgSQL trigger functions currently require a value to be returned, even though that value is not used for anything in case of a trigger fired AFTER. I was wondering if we could relax that. It would make things a bit more robust and produce clearer PL/pgSQL code. The specific case I'm concerned