Re: AW: [HACKERS] Another TEMP table trick

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: Andreas(dot)Zeugswetter(at)telecom(dot)at (Zeugswetter Andreas IZ5)
Cc: hackers(at)postgreSQL(dot)org
Subject: Re: AW: [HACKERS] Another TEMP table trick
Date: 1999-01-30 05:13:47
Message-ID: 199901300513.AAA07673@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> >> test=> create table test (x int);
> >> CREATE
> >> test=> insert into test values (1);
> >> INSERT
> >> test=> create temp table test (x int); <--
> >> CREATE <--
> >> test=> insert into test values (2);
> >> INSERT 19787 1
> >> test=> select * from test;
> >> x
> >> -
> >> 2
> >> (1 row)
> >>
> >> test=> drop table test;
> >> DROP
> >> test=> select * from test;
> >> x
> >> -
> >> 1
> >> (1 row)
> >>
> >> test=> drop table test;
> >> DROP
>
> Do you really think that this should be allowed ? I think table names
> including
> temp tables should (at least in combination with the owner) be unique. I
> think your
> example above demonstrates how confusing the application code can get.

I think it should be allowed. Suppose someone has created a non-temp
table with a certain name, and you want a temp table with that name. No
reason you shouldn't be allowed to do that. Five people can all have
temp tables with the same name, so it doesn't matter if there is a
non-temp table with that name too.

>
> I think it is good, that temp tables are not really inserted into system
> tables,
> since this would be substantial overhead.

Not really much overhead.

> There could be a problem with GUI tools that rely on these rows
> to format their output (like pgaccess or ODBC --> M$ Access) though.

Oh, never thought of that. A select of pg_class will return no rows for
that table because it is a temp table.

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-01-30 05:22:35 Re: [HACKERS] new heap manager mmalloc
Previous Message Vadim Mikheev 1999-01-30 04:40:36 Re: [HACKERS] READ COMMITTED isolevel is implemented ...