From: | Gavin Sherry <swm(at)linuxworld(dot)com(dot)au> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org |
Subject: | CREATE TEMP TABLE .... ON COMMIT |
Date: | 2002-08-09 09:22:52 |
Message-ID: | Pine.LNX.4.21.0208091918180.21494-102000@linuxworld.com.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers pgsql-patches |
Attached is a revised version of my previous
ON COMMIT DROP
patch. This patch implements:
ON COMMIT { DROP | PRESERVE ROWS | DELETE ROWS }
The latter two are SQL99.
Sample usage:
---
template1=# begin;
BEGIN
template1=# create temp table a (a int) on commit drop;
CREATE
template1=# create temp table b (a int) on commit preserve rows;
CREATE
template1=# create temp table c (a int) on commit delete rows;
CREATE
template1=# insert into a values(1);
INSERT 24793 1
template1=# insert into b values(1);
INSERT 24794 1
template1=# insert into c values(1);
INSERT 24795 1
template1=# commit;
COMMIT
template1=# select * from a;
ERROR: Relation "a" does not exist
template1=# select * from b;
a
---
1
(1 row)
template1=# select * from c;
a
---
(0 rows)
template1=# create temp table a (a int) on commit drop;
ERROR: You must be inside a transaction to use ON COMMIT
---
Gavin
Attachment | Content-Type | Size |
---|---|---|
temprel6.diff.gz | application/x-gzip | 4.3 KB |
temprel-doc.diff.gz | application/x-gzip | 1002 bytes |
From | Date | Subject | |
---|---|---|---|
Next Message | Nigel J. Andrews | 2002-08-09 10:12:55 | Re: [HACKERS] Linux Largefile Support In Postgresql RPMS |
Previous Message | Karel Zak | 2002-08-09 08:21:20 | Re: Locale number format confusion |
From | Date | Subject | |
---|---|---|---|
Next Message | Denis A Ustimenko | 2002-08-09 09:48:57 | Re: timed PgConnection::Connect |
Previous Message | Alvaro Herrera | 2002-08-09 05:13:59 | adding PGPASSWORDFILE to libpq |