Mario Splivalo <[EMAIL PROTECTED]> 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 com
On Thu, 2007-01-25 at 11:09 -0500, Tom Lane wrote:
> Mario Splivalo <[EMAIL PROTECTED]> writes:
> > Am I doing something wrong here, or there is no way of using temporary
> > tables within 'sql' written functions?
>
> I believe the problem is that for a SQL function we parse the whole
> function b
On Thu, 2007-01-25 at 11:00 -0500, Andrew Sullivan wrote:
> On Thu, Jan 25, 2007 at 03:39:14PM +0100, Mario Splivalo wrote:
> > When I try to use TEMPORARY TABLE within postgres functions (using 'sql'
> > as a function language), I can't because postgres can't find that
> > temporary table. Conside
On Thu, 2007-01-25 at 08:03 -0800, Stephan Szabo wrote:
> On Thu, 25 Jan 2007, Mario Splivalo wrote:
>
> > When I try to use TEMPORARY TABLE within postgres functions (using 'sql'
> > as a function language), I can't because postgres can't find that
> > temporary table. Consider this example:
> >
Mario Splivalo <[EMAIL PROTECTED]> writes:
> Am I doing something wrong here, or there is no way of using temporary
> tables within 'sql' written functions?
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
in
On Thu, 25 Jan 2007, Mario Splivalo wrote:
> When I try to use TEMPORARY TABLE within postgres functions (using 'sql'
> as a function language), I can't because postgres can't find that
> temporary table. Consider this example:
>
> CREATE FUNCTION func1() RETURNS SETOF v_messages_full AS $BODY$
>
On Thu, Jan 25, 2007 at 03:39:14PM +0100, Mario Splivalo wrote:
> When I try to use TEMPORARY TABLE within postgres functions (using 'sql'
> as a function language), I can't because postgres can't find that
> temporary table. Consider this example:
You need to build the temp table and EXECUTE the
When I try to use TEMPORARY TABLE within postgres functions (using 'sql'
as a function language), I can't because postgres can't find that
temporary table. Consider this example:
CREATE FUNCTION func1() RETURNS SETOF v_messages_full AS $BODY$
CREATE TEMPORARY TABLE tmpTbl
AS
SELECT
messag