Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > pgsql.general > #5

Drop only temporary table

Newsgroups pgsql.general
Date 2016-03-17 10:47 -0700
Message-ID <088a8a8d-7033-4f25-ba13-3a7cdc604028@googlegroups.com> (permalink)
Subject Drop only temporary table
From durumdara@gmail.com

Show all headers | View raw


Dear PG Masters!

As I experienced I can create normal and temp table with same name.

create table x (kod integer);

CREATE TEMPORARY TABLE x (kod integer);

select tablename from pg_tables where schemaname='public'
 union all
select c.relname from pg_class c 
join pg_namespace n on n.oid=c.relnamespace 
where  
n.nspname like 'pg_temp%' 
and c.relkind = 'r' 
and pg_table_is_visible(c.oid);

---

I can see two x tables.

As I see that drop table stmt don't have "temporary" suboption to determine which to need to eliminate - the real or the temporary.

Same thing would happen with other DDL/DML stmts - what is the destination table - the real or the temporary?

"insert into x(kod) values(1)"

So what do you think about this problem?

I want to avoid to remove any real table on resource closing (= dropping of temporary table).

Thanks for your help!

dd

Back to pgsql.general | Previous | Next | Find similar


Thread

Drop only temporary table durumdara@gmail.com - 2016-03-17 10:47 -0700

csiph-web