From: | "Froggy / Froggy Corp(dot)" <froggy(at)froggycorp(dot)com> |
---|---|
To: | Jeff Eckermann <jeff_eckermann(at)yahoo(dot)com>, Mike Nolan <nolan(at)gw(dot)tssi(dot)com>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: PL/SQL question |
Date: | 2004-04-21 20:56:33 |
Message-ID: | 4086E001.2B002E4D@froggycorp.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
I allways get the same error :
ERROR: set-valued function called in context that cannot accept a set
It seems to not accept the "(''test'')". Maybe i made a mistake by
adding the plpgsql langage, but i follow the documentation about that.
If i try to change the insert by "INSERT INTO categorie (id_categorie)
VALUES (''test'');" i got an error msg that "test" is not an integer.
(id_categorie is the primary key of the table).
thx in advance,
regards,
Jeff Eckermann wrote:
>
> --- Mike Nolan <nolan(at)gw(dot)tssi(dot)com> wrote:
> > > In fact the problem seems to come from the
> > "INSERT INTO". I delete
> > > everything from the function and only keep the
> > "INSERT INTO" and get the
> > > same problem.
> >
> > Given that this is supposed to be a trigger
> > function, what's
> > your 'create trigger' statement look like?
> >
> > Part of the problem may be how your 'return null' is
> > being handled,
>
> AFAIK, returning null from a trigger function causes
> the whole operation (insert, update or delete) to be
> aborted, so the transaction is rolled back, including
> the insert inside the function. You want to return
> NEW instead.
>
> > and that can be related to when the trigger fires.
> > --
> > Mike Nolan
> >
> > ---------------------------(end of
> > broadcast)---------------------------
> > TIP 8: explain analyze is your friend
>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Photos: High-quality 4x6 digital prints for 25¢
> http://photos.yahoo.com/ph/print_splash
From | Date | Subject | |
---|---|---|---|
Next Message | Jord Tanner | 2004-04-21 21:43:58 | Re: kill -2 |
Previous Message | Mike Nolan | 2004-04-21 20:34:32 | Re: PL/SQL question |