[HACKERS] create temp table .. on commit delete rows

2006-10-12 Thread Teodor Sigaev
1) # create temp table a ( a int ) without oids on commit delete rows; # insert into a values(1); # begin; # insert into a values(2); # commit; # select * from a; a --- (0 rows) 2) # insert into a values(1); # begin; # insert into a values(2); # rollback; # select * from a; a --- (0 rows) It

Re: [HACKERS] create temp table .. on commit delete rows

2006-10-12 Thread Heikki Linnakangas
Teodor Sigaev wrote: 2) # insert into a values(1); You're running in auto-commit, mode. An implicit commit happens after this statement. Which clears the table. # begin; # insert into a values(2); # rollback; # select * from a; a --- (0 rows) It seems to me that 1) is good, but 2) makes

Re: [HACKERS] create temp table .. on commit delete rows

2006-10-12 Thread Teodor Sigaev
You're running in auto-commit, mode. An implicit commit happens after this statement. Which clears the table. Looks right to me. Oops, I see -- Teodor Sigaev E-mail: [EMAIL PROTECTED] WWW:

Re: [HACKERS] create temp table .. on commit delete rows

2006-10-12 Thread David Fetter
On Thu, Oct 12, 2006 at 03:51:39PM +0400, Teodor Sigaev wrote: You're running in auto-commit, mode. An implicit commit happens after this statement. Which clears the table. Looks right to me. Oops, I see Should something notice and raise a warning when people create a TEMP table and have

Re: [HACKERS] create temp table .. on commit delete rows

2006-10-12 Thread Jim C. Nasby
On Thu, Oct 12, 2006 at 12:01:12PM -0700, David Fetter wrote: On Thu, Oct 12, 2006 at 03:51:39PM +0400, Teodor Sigaev wrote: You're running in auto-commit, mode. An implicit commit happens after this statement. Which clears the table. Looks right to me. Oops, I see Should something

Re: [HACKERS] create temp table .. on commit delete rows

2006-10-12 Thread David Fetter
On Thu, Oct 12, 2006 at 02:07:28PM -0500, Jim C. Nasby wrote: On Thu, Oct 12, 2006 at 12:01:12PM -0700, David Fetter wrote: On Thu, Oct 12, 2006 at 03:51:39PM +0400, Teodor Sigaev wrote: You're running in auto-commit, mode. An implicit commit happens after this statement. Which clears

Re: [HACKERS] create temp table .. on commit delete rows

2006-10-12 Thread Bruce Momjian
David Fetter wrote: On Thu, Oct 12, 2006 at 02:07:28PM -0500, Jim C. Nasby wrote: On Thu, Oct 12, 2006 at 12:01:12PM -0700, David Fetter wrote: On Thu, Oct 12, 2006 at 03:51:39PM +0400, Teodor Sigaev wrote: You're running in auto-commit, mode. An implicit commit happens after this

Re: [HACKERS] create temp table .. on commit delete rows

2006-10-12 Thread Tom Lane
Bruce Momjian [EMAIL PROTECTED] 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

Re: [HACKERS] create temp table .. on commit delete rows

2006-10-12 Thread Bruce Momjian
Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] 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