Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[HACKERS] CREATE TEMP TABLE .... ON COMMIT

9 views
Skip to first unread message

Bruce Momjian

unread,
Aug 27, 2002, 12:29:55 AM8/27/02
to

Gavin, how are you doing with this. As I remember, the only remaining
issue was where to store the 'drop on commit' information in the
backend. If that is all there is, we can come up with a solution.

---------------------------------------------------------------------------

Gavin Sherry wrote:
> On Fri, 9 Aug 2002, Tom Lane wrote:
>
> > Gavin Sherry <s...@linuxworld.com.au> writes:
> > > template1=# create temp table a (a int) on commit drop;
> > > ERROR: You must be inside a transaction to use ON COMMIT
> >
> > Surely that's only for ON COMMIT DROP, if you intend to offer the
> > others?
>
> I should have provided details of this in the email. SQL99 details the
> baviour as follows:
>
> If TEMPORARY is specified and ON COMMIT is omitted, then ON COMMIT
> DELETE ROWS is implicit
>
> This might give users a bit of a surprise so the effective behaviour is ON
> COMMIT PRESERVE ROWS.
>
> As for your question (and, perhaps, SQL99) I don't seen how it makes any
> sense to specify ON COMMIT outside of a transaction block.
>
> >
> > regards, tom lane
> >
>
> Gavin
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>

--
Bruce Momjian | http://candle.pha.pa.us
pg...@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majo...@postgresql.org so that your
message can get through to the mailing list cleanly

Gavin Sherry

unread,
Aug 27, 2002, 1:17:15 AM8/27/02
to
Bruce,

I have a working patch for this I just need to test it further. It occured
to me that there was a bug with the previous implementation in as much as
it didn't handle situations where the user dropped the temp table in a
transaction block. As such, I have added a flag to the structure marking
it dead. This also needs to be undone at ABORT :-). (I knew there was a
reason for storing the ON COMMIT flag in the system catalogs).

Once I have tested further I will send off. If I come across a problem or
cannot get to this by Wednesday (tomorrow) I will send them off to Neil
Conway so that they can make it in. (Unfortunately, I am v. busy atm).

Gavin


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Christopher Kings-Lynne

unread,
Aug 27, 2002, 1:21:34 AM8/27/02
to
What about Gavin's CREATE OR REPLACE stuff?

Chris

> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org

Bruce Momjian

unread,
Aug 27, 2002, 5:24:08 PM8/27/02
to

Your patch has been added to the PostgreSQL unapplied patches list at:

http://candle.pha.pa.us/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---------------------------------------------------------------------------


Gavin Sherry wrote:
> Revised patch is attached.
>
> Passes all regression tests relating to temp tables. (I am getting
> regression test issues with privileges.sql, rules.sql, conversion.sql).

Content-Description:

[ Attachment, skipping... ]

Content-Description:

[ Attachment, skipping... ]

--
Bruce Momjian | http://candle.pha.pa.us
pg...@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------

0 new messages