From: Jan Wieck <janwieck@yahoo.com>
To: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: Murray Prior Hobbs <murray@efone.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: temporary tables, plpgsql and yes i bet this has been asked
Date: Mon, 4 Feb 2002 15:06:26 -0500 (EST)
Message-ID: <200202042006.g14K6QR01773@saturn.janwieck.net> (raw)
In-Reply-To: <200202041413.g14EDtM22394@candle.pha.pa.us>
Bruce Momjian wrote:
> Murray Prior Hobbs wrote:
> >
> > in a plpgsql function
> >
> > create temporary table X
> >
> > ....
> >
> >
> > drop table X
> >
> >
> > then in another function
> >
> > loop
> >
> > call the other function
> >
> > end loop
> >
> >
> > i get the problem that the second time the table is created (ie in the
> > second call) it is not visible
> >
> > now yes i could declare the table in the calling funtion but then the
> > original function is less useful to me
>
> Interesting. Can you recreate the problem in psql without the functions
> and show an example? I am confused how this could be failing.
I bet he's using the temp table without EXECUTE. That
would've failed even without the other "calling" function
around it, as soon as he uses it more than once per session.
SPI still needs to learn how to determine if a query uses
temp tables somewhere in order to silently re-prepare queries
when required. And I am absolutely sure this is not an issue
we should address in PL/pgSQL. It has to be solved on the SPI
level.
Jan
--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck@Yahoo.com #
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: janwieck@yahoo.com, pgman@candle.pha.pa.us, murray@efone.com
Subject: Re: temporary tables, plpgsql and yes i bet this has been asked
In-Reply-To: <200202042006.g14K6QR01773@saturn.janwieck.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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