Re: [GENERAL] Problem with triggers

2010-06-16 Thread Tom Lane
Adrian von Bidder writes: > On Wednesday 16 June 2010 00.56:14 Adrian Klaver wrote: >> The database is beating you to the validation. > With triggers. A question to the experts: Couldn't this, in theory, be > implememnted within the rules system? No, it's pretty much the same problem. If you'

Re: [GENERAL] Problem with triggers

2010-06-15 Thread Sid
2010/6/16 Adrian von Bidder > Heyho! > > On Wednesday 16 June 2010 00.56:14 Adrian Klaver wrote: > > > My question is: why do I get information about too long value before > > > trigger fires? > > > Can I change this behavior? > > I firmly feel friendly error messages like this firmly beong into

Re: [GENERAL] Problem with triggers

2010-06-15 Thread Sid
2010/6/16 Tom Lane > Adrian Klaver writes: > > On 06/15/2010 02:01 PM, Sid wrote: > >> I am writing trigger function for validating values inserted into table. > The > >> goal is to print user friendly messages when inserted value is wrong. > > >> My question is: why do I get information about t

Re: [GENERAL] Problem with triggers

2010-06-15 Thread Adrian von Bidder
Heyho! On Wednesday 16 June 2010 00.56:14 Adrian Klaver wrote: > > My question is: why do I get information about too long value before > > trigger fires? > > Can I change this behavior? I firmly feel friendly error messages like this firmly beong into the application and not into the DB. Next

Re: [GENERAL] Problem with triggers

2010-06-15 Thread Tom Lane
Adrian Klaver writes: > On 06/15/2010 02:01 PM, Sid wrote: >> I am writing trigger function for validating values inserted into table. The >> goal is to print user friendly messages when inserted value is wrong. >> My question is: why do I get information about too long value before trigger >> fi

Re: [GENERAL] Problem with triggers

2010-06-15 Thread Adrian Klaver
On 06/15/2010 02:01 PM, Sid wrote: Hi, I am writing trigger function for validating values inserted into table. The goal is to print user friendly messages when inserted value is wrong. When I check for null values everything works as expected: Inside trigger I have lines: if (new.tvalue is null

[GENERAL] Problem with triggers

2010-06-15 Thread Sid
Hi, I am writing trigger function for validating values inserted into table. The goal is to print user friendly messages when inserted value is wrong. When I check for null values everything works as expected: Inside trigger I have lines: if (new.tvalue is null) then RAISE EXCEPTION 'e

Re: [GENERAL] problem with triggers

2010-01-31 Thread Florent THOMAS
Thank you for answering so fast, After a good night, I found the solution. There was a problem with a variable that was name as a field name I execute in the query. So everything looks fine now! Thanks a lot Le dimanche 31 janvier 2010 à 16:55 -0700, Scott Marlowe a écrit : > On Sun, Jan 31, 20

Re: [GENERAL] problem with triggers

2010-01-31 Thread Scott Marlowe
On Sun, Jan 31, 2010 at 4:53 PM, Florent THOMAS wrote: > Hy everybody, > > I have a problem with 2 triggers. > > I work on 3 tables : > table A ==> with one trigger after insert that insert values in table B > Table B ==> with one trigger after insert that insert values in table C > Table C > As I

[GENERAL] problem with triggers

2010-01-31 Thread Florent THOMAS
Hy everybody, I have a problem with 2 triggers. I work on 3 tables : table A ==> with one trigger after insert that insert values in table B Table B ==> with one trigger after insert that insert values in table C Table C As I insert values on table A, I have a message that indicates the EXECUTE s