Thread: temp table in 8.3

temp table in 8.3

From
"serafin segador"
Date:
hello list,

i am a newbie in postgresql.

i ported a small application to postgresql 8.2 originally written to store
data in maxdb.  since stored procedures are not supported in postgresql
and since postgresql functions cannot return cursor to the calling
applications, i rewrote the maxdb stored procedures into functions that
store rows in temp tables and return the temp table name to the
application ( saves on coding the select string in the application) , and
retrieve the rows from the temp table within the same session.  this i can
no longer do after upgrading to 8.3.  is there any thing i can do to
restore this functionality i can get in 8.2, like configuration tweaking,
apart from recoding the select string in the application.

regards and any help is highly appreciated,

raffy segador



--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/


Re: temp table in 8.3

From
"Scott Marlowe"
Date:
On Feb 19, 2008 10:37 PM, serafin segador <rsegador@mydestiny.net> wrote:
>
> hello list,
>
> i am a newbie in postgresql.

Why are you posting the same request twice?

> i ported a small application to postgresql 8.2 originally written to store
> data in maxdb.  since stored procedures are not supported in postgresql
> and since postgresql functions cannot return cursor to the calling
> applications,

Maybe the docs would come in handy here.

1: Postgresql supports returning cursors from functions, and has for a
very long time.
2: It also supports returning sets of  records.  Both of these are
covered in the docs on plpgsql.

http://www.postgresql.org/docs/8.3/static/plpgsql-cursors.html
http://www.postgresql.org/docs/8.3/static/plpgsql-control-structures.html#PLPGSQL-STATEMENTS-RETURNING


> i rewrote the maxdb stored procedures into functions that
> store rows in temp tables and return the temp table name to the
> application ( saves on coding the select string in the application) , and
> retrieve the rows from the temp table within the same session.  this i can
> no longer do after upgrading to 8.3.  is there any thing i can do to
> restore this functionality i can get in 8.2, like configuration tweaking,
> apart from recoding the select string in the application.

There's no reason it shouldn't work, but this method is suboptimal.
Do you have something a little more useful, like an error / syntax
message?