Thread: Function Problem

Function Problem

From
Jamie Deppeler
Date:
Problem
I am trying to store value in a TEMPORARY table and I am getting the
following error

ERROR: relation with OID 51533 does not exist


Trigger
CREATE TRIGGER "createtemporytable" AFTER INSERT
ON "component" FOR EACH ROW
EXECUTE PROCEDURE "createtemp"();


Function
begin
   CREATE temporary TABLE primarykey
   (
    componentpk Integer,
    plannerpk Integer,
    materialplanpk Integer,
    resourceplanpk Integer
   );


   INSERT INTO primarykey(componentpk)
   VALUES (new."primary");

   UPDATE component
     set "notes" = 'Updated'
   where component."primary" = primarykey.componentpk;

end

Re: Function Problem

From
Michael Fuhr
Date:
On Mon, Dec 06, 2004 at 10:34:12AM +1100, Jamie Deppeler wrote:

> I am trying to store value in a TEMPORARY table and I am getting the
> following error
>
> ERROR: relation with OID 51533 does not exist

The FAQ has a question regarding functions and temporary tables.
See also past discussion in the list archives.

http://www.postgresql.org/docs/faqs/FAQ.html
http://archives.postgresql.org/

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/