Re: temp tables ORACLE/PGSQL - Mailing list pgsql-general

From Pavel Stehule
Subject Re: temp tables ORACLE/PGSQL
Date
Msg-id Pine.LNX.4.44.0504281936380.22687-100000@kix.fsv.cvut.cz
Whole thread Raw
In response to temp tables ORACLE/PGSQL  (fisher73@gazeta.pl (NO-fisher-SPAM_PLEASE))
List pgsql-general
> Hi
> I used to work with Oracle and now tryin' PostgreSQL I'm a bit
> confused.
> I found that creating temp table in one session does not  make it
> available for other sessions for the same user? Is this intended??

Yes, it's natural behave of temp. tables in PostgreSQL. The life cycle of
temp tables is related with session. When session ends then all temp
tables are destroyed. When you wont to use temp tables again, you have to
create it again.

> I was tryin to use because of lack of session and package variables in
> PGSQL (thats what I know).  But I'm not sure if I have to create  a
> temp table at the beginning of each session? Or just like in Oracle
> create temp table definition and all whats temporar is data.

You will lost table definition.

>
> If creating a temp table for each connection is a must then maybe You
> can tell me if there is any triger /event  that is being called during
> connecting to db. I guess that would be the best place to create temp
> tables and feed it up with session parameters.

No there are not table or session triggers. You have to create temp tables
from application.

Regards
Pavel Stehule


pgsql-general by date:

Previous
From: "John D. Burger"
Date:
Subject: Re: ERROR: Could not convert UTF-8 to ISO8859-1
Next
From: Dennis Sacks
Date:
Subject: Re: temp tables ORACLE/PGSQL