Re: [GENERAL] Drop only temporary table

2016-03-20 Thread Aleksander Alekseev
You can use schema name as a prefix: postgres=# \d+ List of relations Schema | Name | Type | Owner |Size| Description ---+--+---+--++- pg_temp_1 | t| table | postgres | 8192 bytes | (1 row) postgres=# dr

Re: [GENERAL] Drop only temporary table

2016-03-19 Thread David G. Johnston
On Friday, March 18, 2016, Durumdara wrote: > > 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. > > If you have to explicitly drop a temporary table you are likely doing something wrong.

Re: [GENERAL] Drop only temporary table

2016-03-19 Thread Melvin Davidson
On Fri, Mar 18, 2016 at 9:31 AM, Aleksander Alekseev < a.aleks...@postgrespro.ru> wrote: > You can use schema name as a prefix: > > postgres=# \d+ >List of relations > Schema | Name | Type | Owner |Size| Description > ---+--+---+--+--

[GENERAL] Drop only temporary table

2016-03-18 Thread Durumdara
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.relname

Re: [GENERAL] Drop only temporary table

2016-03-18 Thread Tom Lane
Durumdara writes: > As I experienced I can create normal and temp table with same name. Sure. > As I see that drop table stmt don't have "temporary" suboption to determine > which to need to eliminate - the real or the temporary. Once you've created a temp table, it masks any normal table of th