Re: Temp tables are curious creatures....

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Rod Taylor <rbt(at)zort(dot)ca>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Temp tables are curious creatures....
Date: 2002-04-30 01:35:21
Message-ID: 200204300135.g3U1ZLq25142@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-04-30 01:50:19 Civility of core/hackers group
Previous Message Tom Lane 2002-04-30 01:35:04 Re: Temp tables are curious creatures....