Обсуждение: Creating temporary table

Поиск
Список
Период
Сортировка

Creating temporary table

От
Uros Gruber
Дата:
Hi!

I want to make some SQL function, wich gets some data for
example 4 rows, if i want to return this data back i think
that i have put this data into temp table and then read this.

Now i have 2 questions, How long this temporary table exist,
will be avaliable after function ends or i have to use begin
to start session and then end when i get this data.

Or is there any other way to do this.


--
bye
 Uros                          mailto:uros.gruber@sir-mag.com


Re: Creating temporary table

От
"PG Explorer"
Дата:
Temp tables are only valid within the current session.
As soon as the session ends the table is dropped.

That is as soon as the use that is logged on to the database disconnects or
closes its connection

Thus, yes, it will be available when the function ends but the connection
must not close.
Beware of using temp tables in PHP, as soon as the PHP page finishes the
temp table will be gone.

http://www.pgexplorer.com
PostgresSQL Windows Frontend


----- Original Message -----
From: "Uros Gruber" <uros.gruber@sir-mag.com>
To: <pgsql-general@postgresql.org>
Sent: Saturday, March 30, 2002 12:34 AM
Subject: [GENERAL] Creating temporary table


> Hi!
>
> I want to make some SQL function, wich gets some data for
> example 4 rows, if i want to return this data back i think
> that i have put this data into temp table and then read this.
>
> Now i have 2 questions, How long this temporary table exist,
> will be avaliable after function ends or i have to use begin
> to start session and then end when i get this data.
>
> Or is there any other way to do this.
>
>
> --
> bye
>  Uros                          mailto:uros.gruber@sir-mag.com
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org