Re: CREATE TEMP TABLE AS SELECT/ GET DIAGNOSTICS ROW_COUNT

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)surnet(dot)cl>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, MLikharev(at)micropat(dot)com, pgsql-general(at)postgresql(dot)org
Subject: Re: CREATE TEMP TABLE AS SELECT/ GET DIAGNOSTICS ROW_COUNT
Date: 2005-06-09 21:28:43
Message-ID: 7058.1118352523@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alvaro Herrera <alvherre(at)surnet(dot)cl> 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 immediate problem.

Done. Here is the patch (against CVS tip, but it should apply with
some fuzz in 8.0 or 7.4).

regards, tom lane

*** src/backend/executor/spi.c.orig Fri May 6 15:59:49 2005
--- src/backend/executor/spi.c Thu Jun 9 16:59:37 2005
***************
*** 1497,1502 ****
--- 1497,1503 ----
_SPI_pquery(QueryDesc *queryDesc, long tcount)
{
int operation = queryDesc->operation;
+ CommandDest origDest = queryDesc->dest->mydest;
int res;
Oid save_lastoid;

***************
*** 1548,1554 ****

ExecutorEnd(queryDesc);

! if (queryDesc->dest->mydest == SPI)
{
SPI_processed = _SPI_current->processed;
SPI_lastoid = save_lastoid;
--- 1549,1556 ----

ExecutorEnd(queryDesc);

! /* Test origDest here so that SPI_processed gets set in SELINTO case */
! if (origDest == SPI)
{
SPI_processed = _SPI_current->processed;
SPI_lastoid = save_lastoid;

In response to

Browse pgsql-general by date

  From Date Subject
Next Message MLikharev 2005-06-09 21:45:56 Re: CREATE TEMP TABLE AS SELECT/ GET DIAGNOSTICS ROW_COUNT
Previous Message Thomas Kellerer 2005-06-09 21:22:26 Re: Version Control?