Re: create temp table .. on commit delete rows

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: David Fetter <david(at)fetter(dot)org>, "Jim C(dot) Nasby" <jim(at)nasby(dot)net>, Teodor Sigaev <teodor(at)sigaev(dot)ru>, Heikki Linnakangas <heikki(at)enterprisedb(dot)com>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: create temp table .. on commit delete rows
Date: 2006-10-12 22:17:35
Message-ID: 20078.1160691455@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <bruce(at)momjian(dot)us> writes:
> David Fetter wrote:
>>> Should something notice and raise a warning when people create a
>>> TEMP table and have AUTOCOMMIT on?

> Added to TODO:
> o Issue a notice if CREATE TABLE ... ON COMMIT { DELETE ROWS |
> DROP } is issued outside a multi-statement transaction

That is *not* what was suggested, and it doesn't seem very useful. The
problem really comes when one uses a temp table in autocommit mode, not
at creation time.

The problem with the original suggestion is that the backend can't do it
because AUTOCOMMIT is a notion that exists only in the client-side code.
And the client can't do it very well because it'd have to parse SQL
commands, and even with that it wouldn't see CREATE TEMP TABLE commands
issued inside functions.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2006-10-12 22:32:50 Re: create temp table .. on commit delete rows
Previous Message Jeff Davis 2006-10-12 22:15:03 Re: Hints proposal