Re: [GENERAL] CREATE TEMP TABLE AS ... ON COMMIT DROP fails

2005-11-06 Thread Tom Lane
"Andrus Moor" <[EMAIL PROTECTED]> writes: > CREATE TEMP TABLE t2 AS SELECT * FROM t1 ON COMMIT DROP; > Causes ERROR: syntax error at or near "ON" at character 104 Not implemented, as the manual clearly states. > How to implement this ? Create the temp table with a plain CREATE, then fill it wit

Re: [GENERAL] CREATE TEMP TABLE AS ... ON COMMIT DROP fails

2005-11-06 Thread Rick
In article <[EMAIL PROTECTED]>, Andrus Moor <[EMAIL PROTECTED]> wrote: >I need to create temporary table with data which is dropped at end of >transaction. > >CREATE TABLE t1 ( c1 INTEGER ) ; >INSERT INTO t1 VALUES (1); >CREATE TEMP TABLE t2 AS SELECT * FROM t1 ON COMMIT DROP; > >Causes ERROR: sy

Re: [GENERAL] CREATE TEMP TABLE AS SELECT/ GET DIAGNOSTICS ROW_COUNT again

2005-09-19 Thread Ilja Golshtein
Hi! >This change relates only to SPI, meaning plpsql. It does not help libpq. Thanks for response. I see. Any hope it would be possible to calculate number of rows inserted in newly created table via CREATE .. AS SELECT? -- Best regards Ilja Golshtein ---(end of broa

Re: [GENERAL] CREATE TEMP TABLE AS SELECT/ GET DIAGNOSTICS ROW_COUNT

2005-09-19 Thread Bruce Momjian
This change relates only to SPI, meaning plpsql. It does not help libpq. --- Ilja Golshtein wrote: > Hello! > > According to Tom's message > http://archives.postgresql.org/pgsql-general/2005-06/msg00476.php > we have the s

Re: [GENERAL] CREATE TEMP TABLE AS SELECT/ GET DIAGNOSTICS ROW_COUNT

2005-06-10 Thread Bruce Momjian
Ilja Golshtein wrote: > Hi! > > >Done. Here is the patch (against CVS tip, but it should apply with > >some fuzz in 8.0 or 7.4). > > Is this patch about CREATE TEMP TABLE AS SELECT only, > or about SELECT INTO TEMP TABLE as well? It should handle both because internally they are the same. --

Re: [GENERAL] CREATE TEMP TABLE AS SELECT/ GET DIAGNOSTICS ROW_COUNT

2005-06-09 Thread Ilja Golshtein
Hi! >Done. Here is the patch (against CVS tip, but it should apply with >some fuzz in 8.0 or 7.4). Is this patch about CREATE TEMP TABLE AS SELECT only, or about SELECT INTO TEMP TABLE as well? -- Best regards Ilja Golshtein ---(end of broadcast)---

Re: [GENERAL] CREATE TEMP TABLE AS SELECT/ GET DIAGNOSTICS ROW_COUNT

2005-06-09 Thread MLikharev
Thanks. Alvaro Herrera <[EMAIL PROTECTED]> writes: > On Tue, May 31, 2005 at 03:43:56PM -0400, Tom Lane wrote: >> OK, next question: is this a bug fix we should back-patch into 7.4, >> or just change it in HEAD? > I guess apply only in HEAD, and provide the patch for MLikharev so he > can solve h

Re: [GENERAL] CREATE TEMP TABLE AS SELECT/ GET DIAGNOSTICS ROW_COUNT

2005-06-09 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > On Tue, May 31, 2005 at 03:43:56PM -0400, Tom Lane wrote: >> OK, next question: is this a bug fix we should back-patch into 7.4, >> or just change it in HEAD? > I guess apply only in HEAD, and provide the patch for MLikharev so he > can solve his immedi

Re: [GENERAL] CREATE TEMP TABLE AS SELECT/ GET DIAGNOSTICS

2005-05-31 Thread Neil Conway
On Tue, 2005-05-31 at 15:43 -0400, Tom Lane wrote: > OK, next question: is this a bug fix we should back-patch into 7.4, > or just change it in HEAD? I agree with Alvaro: fix it in HEAD, but don't backport the change to 8.0 or 7.4. -Neil ---(end of broadcast)---

Re: [GENERAL] CREATE TEMP TABLE AS SELECT/ GET DIAGNOSTICS ROW_COUNT

2005-05-31 Thread Alvaro Herrera
On Tue, May 31, 2005 at 03:43:56PM -0400, Tom Lane wrote: > Alvaro Herrera <[EMAIL PROTECTED]> writes: > > On Tue, May 31, 2005 at 01:03:30AM -0400, Tom Lane wrote: > >> So the initial evidence is that this was not an intentional change. > >> Do we want to revert it? The behavior has been in the f

Re: [GENERAL] CREATE TEMP TABLE AS SELECT/ GET DIAGNOSTICS ROW_COUNT

2005-05-31 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > On Tue, May 31, 2005 at 01:03:30AM -0400, Tom Lane wrote: >> So the initial evidence is that this was not an intentional change. >> Do we want to revert it? The behavior has been in the field now for >> more than a full release cycle --- all 7.4.* relea

Re: [GENERAL] CREATE TEMP TABLE AS SELECT/ GET DIAGNOSTICS ROW_COUNT

2005-05-31 Thread Alvaro Herrera
On Tue, May 31, 2005 at 01:03:30AM -0400, Tom Lane wrote: > So the initial evidence is that this was not an intentional change. > Do we want to revert it? The behavior has been in the field now for > more than a full release cycle --- all 7.4.* releases behave this way > --- so one could argue th

Re: [GENERAL] CREATE TEMP TABLE AS SELECT/ GET DIAGNOSTICS ROW_COUNT

2005-05-30 Thread Tom Lane
Bruce Momjian writes: > I found a discussion of this issue from December, 2004: > http://archives.postgresql.org/pgsql-general/2004-12/msg00070.php That was the same complainant ;-) I dug through the CVS history and determined that the behavior changed at spi.c rev 1.87: 2003-03-09 22:53

Re: [GENERAL] CREATE TEMP TABLE AS SELECT/ GET DIAGNOSTICS ROW_COUNT

2005-05-30 Thread Bruce Momjian
I found a discussion of this issue from December, 2004: http://archives.postgresql.org/pgsql-general/2004-12/msg00070.php The discussion trailed off with the idea that because no rows were returned to the function, the row_count should be zero, but then there was some discussion that FOU

Re: [GENERAL] CREATE TEMP TABLE AS SELECT/ GET DIAGNOSTICS ROW_COUNT

2005-05-30 Thread MLikharev
Hello, I was not able to find any traces from the previous discussion trend, but I believe that finished when I replaced GET DIAGNOSTIC with SELECT COUNT(). Perfectly fine workaround, but more I look at that more I see why GET DIAGNOSTIC was so convenient not to mentioned that SELECT COUNT() is

Re: [GENERAL] CREATE TEMP TABLE AS SELECT/ GET DIAGNOSTICS ROW_COUNT

2005-05-30 Thread Tom Lane
Bruce Momjian writes: > Can someone in the community comment on this question? I don't know the > answer. I think it could be changed back without much work, but I have a feeling that we'd deliberately decided on the change of behavior. Can anyone recall a prior discussion, or want to vote with

Re: [GENERAL] CREATE TEMP TABLE AS SELECT/ GET DIAGNOSTICS ROW_COUNT

2005-05-30 Thread Bruce Momjian
Can someone in the community comment on this question? I don't know the answer. --- [EMAIL PROTECTED] wrote: > Hi, I was asking this question some time ago and was under impression > that this will be fixed in 8.x. In gener

Re: [GENERAL] create temp table and on commit in 7.3.3

2005-02-09 Thread Michael Fuhr
On Wed, Feb 09, 2005 at 03:40:49PM -0500, Tom Lane wrote: > Michael Fuhr <[EMAIL PROTECTED]> writes: > > The 7.3 and 7.2 documentation for CREATE TABLE both mention ON COMMIT: > > > http://www.postgresql.org/docs/7.3/static/sql-createtable.html#SQL-CREATETABLE-COMPATIBILITY > > http://www.postgres

Re: [GENERAL] create temp table and on commit in 7.3.3

2005-02-09 Thread Tom Lane
Michael Fuhr <[EMAIL PROTECTED]> writes: > The 7.3 and 7.2 documentation for CREATE TABLE both mention ON COMMIT: > http://www.postgresql.org/docs/7.3/static/sql-createtable.html#SQL-CREATETABLE-COMPATIBILITY > http://www.postgresql.org/docs/7.2/static/sql-createtable.html#SQL-CREATETABLE-COMPATIB

Re: [GENERAL] create temp table and on commit in 7.3.3

2005-02-08 Thread Antony Paul
I learned that there is an on commit clause by looking at the Compaitiblity section of the 7.3.3 docs and I was confused whether it is supporting this or not rgds Antony Paul On Wed, 9 Feb 2005 00:19:41 -0700, Michael Fuhr <[EMAIL PROTECTED]> wrote: > On Wed, Feb 09, 2005 at 06:00:52PM +1100, N

Re: [GENERAL] create temp table and on commit in 7.3.3

2005-02-08 Thread Michael Fuhr
On Wed, Feb 09, 2005 at 06:00:52PM +1100, Neil Conway wrote: > On Wed, 2005-02-09 at 10:48 +0530, Antony Paul wrote: > > Hi all, > > This is giving error in 7.3.3. > > > > CREATE TEMP TABLE temptest3(col int PRIMARY KEY) ON COMMIT DELETE ROWS; > > ERROR: parser: parse error at or near "ON" a

Re: [GENERAL] create temp table and on commit in 7.3.3

2005-02-08 Thread Neil Conway
On Wed, 2005-02-09 at 10:48 +0530, Antony Paul wrote: > Hi all, > This is giving error in 7.3.3. > > CREATE TEMP TABLE temptest3(col int PRIMARY KEY) ON COMMIT DELETE ROWS; > ERROR: parser: parse error at or near "ON" at character 51 > > Is this supported. No. Looking at the manual would h

Re: [GENERAL] CREATE TEMP TABLE

2004-03-26 Thread Bill Moran
Juris Krumins wrote: Hi everybody. I have a problem with my PostgreSQL DBMS. In serverl log file I periodicly have errors like: 2004-03-24 11:43:18 ERROR: Relation "tmp_table1" does not exist 2004-03-24 11:43:18 ERROR: Relation "tmp_table1" does not exist 2004-03-24 11:43:18 ERROR: Relation 'tmp

Re: [GENERAL] CREATE TEMP TABLE

2004-03-26 Thread Bruce Momjian
See the FAQ entry about temp tables in function. Use EXECUTE. --- Juris Krumins wrote: > > Hi everybody. I have a problem with my PostgreSQL DBMS. > In serverl log file I periodicly have errors like: > > 2004-03-24 11:43: