Re: Using Temporary Tables in postgres functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: mario(dot)splivalo(at)mobart(dot)hr
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Using Temporary Tables in postgres functions
Date: 2007-01-26 14:57:32
Message-ID: 23176.1169823452@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Mario Splivalo <mario(dot)splivalo(at)mobart(dot)hr> writes:
> On Thu, 2007-01-25 at 11:09 -0500, Tom Lane wrote:
>> I believe the problem is that for a SQL function we parse the whole
>> function body before executing any of it. So you'd need to split this
>> into two separate functions.

> Having two function complicates, a bit, interface between applicaation
> and the database. But, then again, If I split it in two functions, then
> one with the UPDATE still can't find temp table referenced in other
> function, right?

It can as long as the table already exists when the function is entered.

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Luís Sousa 2007-01-26 17:24:52 Function returning SETOF using plpythonu
Previous Message Rob V 2007-01-26 14:44:43 Re: LEFT Join Question