Re: PL/pgSQL bug? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: PL/pgSQL bug?
Date
Msg-id 2351.997671880@sss.pgh.pa.us
Whole thread Raw
In response to Re: PL/pgSQL bug?  (Tatsuo Ishii <t-ishii@sra.co.jp>)
List pgsql-hackers
Tatsuo Ishii <t-ishii@sra.co.jp> writes:
> CREATE FUNCTION myftest(INT)
> RETURNS INT
> AS '
>   UPDATE t1 SET i = 1 WHERE i = 1;
>   COPY t1 TO ''/tmp/t1.data'';
>   SELECT i FROM t1 WHERE i = (SELECT i FROM t1 WHERE i = 1);
>  '
>  LANGUAGE 'sql';

> When COPY is invoked in the function, I thought SetQuerySnapshot is
> called.

Hmm, I think you are right.  This means that calling SetQuerySnapshot
in ProcessUtility is the *wrong* place to do it; or that there should
be additional logic to suppress the call in this context.  IMHO, anyway.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: Re: PL/pgSQL bug?
Next
From: Tom Lane
Date:
Subject: Re: Portal destination issue: binary vs normal cursors