Re: temp tables and sequences in functions

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: temp tables and sequences in functions
Date: 2007-09-05 14:05:44
Message-ID: 20070905140544.GB19358@a-kretschmer.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

am Wed, dem 05.09.2007, um 6:58:30 -0700 mailte Rob folgendes:
> What is the proper why to deal with temp tables and sequences? Why aren't they
> being dropped after the function ends? Why do I get OID errors if I delete the
> temp table/sequence at the end of the function and then try to rerun the
> function?
>
> ERROR: could not open relation with OID 58341
> SQL state: XX000

normal behavior. Read more about this problem here:
http://merlinmoncure.blogspot.com/2007/09/as-previously-stated-postgresql-8.html

Solution: use EXECUTE for DDL-commands inside functions.

Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net

In response to

Browse pgsql-general by date

  From Date Subject
Next Message SHARMILA JOTHIRAJAH 2007-09-05 14:23:47 how to find the number of rows inserted into the master table?
Previous Message Rob 2007-09-05 13:58:30 temp tables and sequences in functions