Drop only temporary table

Поиск
Список
Период
Сортировка
От Durumdara
Тема Drop only temporary table
Дата
Msg-id CAEcMXhkGbRKGOQ=24AbXebNuf2h+A_Y9nWu+16eQ4F2XGK3_7Q@mail.gmail.com
обсуждение исходный текст
Ответы Re: Drop only temporary table  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Drop only temporary table  (Aleksander Alekseev <a.alekseev@postgrespro.ru>)
Re: Drop only temporary table  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general
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).
How to I force "drop only temporary"? Prefix, option, etc.

Thanks for your help!

dd

В списке pgsql-general по дате отправления:

Предыдущее
От: Jan de Visser
Дата:
Сообщение: Re: Crypt change in 9.4.5
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Drop only temporary table