Cant find temp tables

Started by Nonameabout 20 years ago5 messagesgeneral
Jump to latest
#1Noname
sconeek@gmail.com

hi all,
i am struggling with temp tables. i have a statement like CREATE TEMP
TABLE test (a BIGINT);
it executes successfully, hence i know that the table has been created.
but i cant see the table within the DB using PGADMIN. if i do SELECT *
FROM test; it returns 0 records, but it still tells me that the table
exists with no data inside it. if i do a DROP TABLE test; it deletes
the table too. so everything is pointing to the fact that the table is
created, contains no data, but i cant see it. there is only one schema
(public) too.
can somebody please help me out.
thanks.

#2Chris
dmagick@gmail.com
In reply to: Noname (#1)
Re: Cant find temp tables

sconeek@gmail.com wrote:

hi all,
i am struggling with temp tables. i have a statement like CREATE TEMP
TABLE test (a BIGINT);
it executes successfully, hence i know that the table has been created.
but i cant see the table within the DB using PGADMIN. if i do SELECT *
FROM test; it returns 0 records, but it still tells me that the table
exists with no data inside it. if i do a DROP TABLE test; it deletes
the table too. so everything is pointing to the fact that the table is
created, contains no data, but i cant see it. there is only one schema
(public) too.
can somebody please help me out.

Sounds like a bug in pgadmin.

Might be better asking that list though:

http://www.pgadmin.org/support/

--
Postgresql & php tutorials
http://www.designmagick.com/

#3Noname
sconeek@gmail.com
In reply to: Chris (#2)
Re: Cant find temp tables

could be. i will have a look at the pgadmin site and see if i can find
anything. but the pgadmin guys couldnt have missed this problem, seems
to be pretty important functionality. thanks.

#4Dave Page
dpage@pgadmin.org
In reply to: Noname (#3)
Re: Cant find temp tables

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of
sconeek@gmail.com
Sent: 03 April 2006 01:21
To: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Cant find temp tables

could be. i will have a look at the pgadmin site and see if i
can find anything. but the pgadmin guys couldnt have missed
this problem, seems to be pretty important functionality. thanks.

Hi, pgAdmin guy here!

There are a couple of issues to consider when trying to use temp tables
in pgAdmin:

1) They live in pg_temp_NN schemas, which by default are hidden. Turn on
Display -> System Objects to see them.

2) pgAdmin uses a separate connection for query tool windows. Because
temp tables exist only for the life of the session, if you close the
query tool (or whatever other session you created the table in), all the
pg_class/pg_attribute rows will be removed so pgAdmin won't see them no
matter how much you refresh the tree.

Regards, Dave.

#5Mike Adams
madams55075@comcast.net
In reply to: Dave Page (#4)
Re: Cant find temp tables

Dave Page wrote:

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of
sconeek@gmail.com
Sent: 03 April 2006 01:21

...snip

2) pgAdmin uses a separate connection for query tool windows. Because
temp tables exist only for the life of the session, if you close the
query tool (or whatever other session you created the table in), all the
pg_class/pg_attribute rows will be removed so pgAdmin won't see them no
matter how much you refresh the tree.

Regarding item 2), is there a way to *disconnect* pgAdmin from a
database (ie drop the connection) thereby allowing you to modify
template1 for example, disconnect from template1 so another person can
initdb using template1 on another connection w/o you having to shutdown
pgAdmin?