pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedProblems with temp table and PL
3+ messages / 3 participants
[nested] [flat]
* Problems with temp table and PL
@ 2007-02-21 21:17 Martin Marques <martin@bugs.unl.edu.ar>
0 siblings, 2 replies; 3+ messages in thread
From: Martin Marques @ 2007-02-21 21:17 UTC (permalink / raw)
To: pgsql-sql
I create a temp table inside a plpgsql function, which is drop just before
ending (the function).
My problem is that if I execute the same function again (in the same
session) I get an error when trying to insert data into it (looks like the
session has an old reference of the table):
=> SELECT actualizacionAnualProximoHabil(2008);
ERROR: relation with OID 9668312 does not exist
CONTEXT: SQL statement "INSERT INTO dias_semana VALUES ( $1 )"
PL/pgSQL function "actualizacionanualproximohabil" line 9 at SQL statement
As I said, the first execution works OK, but from then on it gives this
error, until I close the session and open it again.
Any ideas?
--
21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18
---------------------------------------------------------
Lic. Martín Marqués | SELECT 'mmarques' ||
Centro de Telemática | '@' || 'unl.edu.ar';
Universidad Nacional | DBA, Programador,
del Litoral | Administrador
---------------------------------------------------------
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Problems with temp table and PL
@ 2007-02-21 21:34 Andrew Sullivan <ajs@crankycanuck.ca>
parent: Martin Marques <martin@bugs.unl.edu.ar>
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Sullivan @ 2007-02-21 21:34 UTC (permalink / raw)
To: pgsql-sql
On Wed, Feb 21, 2007 at 06:17:50PM -0300, Martin Marques wrote:
> My problem is that if I execute the same function again (in the same
> session) I get an error when trying to insert data into it (looks like the
> session has an old reference of the table):
You have to use EXECUTE for this. See the docs.
A
--
Andrew Sullivan | ajs@crankycanuck.ca
I remember when computers were frustrating because they *did* exactly what
you told them to. That actually seems sort of quaint now.
--J.D. Baldwin
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Problems with temp table and PL
@ 2007-02-21 21:37 A. Kretschmer <andreas.kretschmer@schollglas.com>
parent: Martin Marques <martin@bugs.unl.edu.ar>
1 sibling, 0 replies; 3+ messages in thread
From: A. Kretschmer @ 2007-02-21 21:37 UTC (permalink / raw)
To: pgsql-sql
am Wed, dem 21.02.2007, um 18:17:50 -0300 mailte Martin Marques folgendes:
> I create a temp table inside a plpgsql function, which is drop just before
> ending (the function).
>
> My problem is that if I execute the same function again (in the same
> session) I get an error when trying to insert data into it (looks like the
> session has an old reference of the table):
Right. Use EXECUTE for DDL-commands.
Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2007-02-21 21:37 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-02-21 21:17 Problems with temp table and PL Martin Marques <martin@bugs.unl.edu.ar>
2007-02-21 21:34 ` Andrew Sullivan <ajs@crankycanuck.ca>
2007-02-21 21:37 ` A. Kretschmer <andreas.kretschmer@schollglas.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox