Skip site navigation (1) Skip section navigation (2)

Re: Are temp table really invisible for existing table

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rahul_g(at)ip(dot)eth(dot)net, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Are temp table really invisible for existing table
Date: 2001-08-03 14:47:38
Message-ID: 20320.996850058@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
pgsql-bugs(at)postgresql(dot)org writes:
>  but, when i try to create a new table (not temp) with the same name
>  as that of name of temporary table recently created it gives me
>  message as "the table already exists"

This is the intended behavior...

> should it be happened ?

Dunno.  As things currently stand, the only thing we could do
differently is to automatically drop the temp table when we see a
regular create for the same name.  (If we don't, the existence of
the temp table creates naming conflicts that will cause problems
for the regular create.)  That doesn't seem like a great idea to me.

> *  Is there any function to check the existance of temporary table,

Not at the moment.  You might consider creating the temp table at the
start of a client session, and letting the function just assume that
it exists.  (Once we implement schemas it should be possible to look
in the system catalogs to check existence of a temp table, but the
way it's done right now is a kluge that's not reflected in the
catalogs.)

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Bruce MomjianDate: 2001-08-03 16:19:57
Subject: Re: Are temp table really invisible for existing table
Previous:From: pgsql-bugsDate: 2001-08-03 10:15:54
Subject: Are temp table really invisible for existing table

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group