Re: Temp tables are curious creatures.... - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Temp tables are curious creatures....
Date
Msg-id 200204300135.g3U1ZLq25142@candle.pha.pa.us
Whole thread Raw
In response to Temp tables are curious creatures....  (Rod Taylor <rbt@zort.ca>)
Responses Re: Temp tables are curious creatures....  (Hannu Krosing <hannu@tm.ee>)
List pgsql-hackers
I think you have to use the backend pid to find your own.  I think
there is a libpq function that returns the backend pis so psql can
frame the proper query.

---------------------------------------------------------------------------

Rod Taylor wrote:
> Appears psql needs to know how to differentiate between it's own temp
> tables and those of another connection.  On the plus side, this takes
> care of a TODO item to add temp table listings to psql.
> 
> Connection 1:
> 
> template1=# create temp table junk(col1 int4);
> CREATE
> template1=# select * from junk;
>  col1 
> ------
> (0 rows)
> 
> 
> Connection 2:
> template1=# \d
>   List of relations
>  Name | Type  | Owner 
> ------+-------+-------
>  junk | table | rbt
> (1 row)
> 
> template1=# select * from junk;
> ERROR:  Relation "junk" does not exist
> 
> template1=# create temp table junk (col4 text);
> CREATE
> 
>   List of relations
>  Name | Type  | Owner 
> ------+-------+-------
>  junk | table | rbt
>  junk | table | rbt
> 
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
> 

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Temp tables are curious creatures....
Next
From: Bruce Momjian
Date:
Subject: Civility of core/hackers group