Re: Alter Temporary table in Stored Procedure

From: "Nykolyn, Andrew" <andrew(dot)nykolyn(at)ngc(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Alter Temporary table in Stored Procedure
Date: 2008-02-10 20:09:20
Message-ID: F45D63E8C730D04F899B1227D5D03FD8C55336@XMBIL101.northgrum.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Does any know of a way that I can alter a temporary table by adding a
> serial column within a stored procedure after it has been created?

It should just work. What did you try, exactly, and what error message
did you get?

I have the following code in my stored procedure:

create temporary table t_resultset as select * from
get_createtempmsg();

alter table t_resultset add column seq serial;

Where get_createtempmsg() is a stored procedure that returns a composite
type with no records.

The error I get is - relation "public.t_resultset" does not exist.

I am using 8.1.3

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dave Livesay 2008-02-10 20:32:43 Re: ERROR: expected just one rule action
Previous Message Tom Lane 2008-02-10 19:21:44 Re: ERROR: expected just one rule action