Re: [HACKERS] BUG #4516: FOUND variable does not work after RETURN QUERY

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, pgsql-bugs(at)postgresql(dot)org, postgres hackers <pgsql-hackers(at)postgresql(dot)org>, Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
Subject: Re: [HACKERS] BUG #4516: FOUND variable does not work after RETURN QUERY
Date: 2009-02-04 18:32:47
Message-ID: 200902041832.n14IWl001637@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Robert Haas wrote:
> > 2009/1/10 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> >> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> >>> Uh, is this ready to be applied?
> >>
> >> I don't think any consensus has been reached on changing this behavior.
> >
> > I thing, so this is bug - RETURN QUERY has to supply FOR SELECT LOOP
> > RETURN NEXT pattern.
> >
> > My first patch expected so RETURN QUERY is final statement, so I don't
> > solve FOUND variable, but Heikki changed this behave.
> >
> > Without correct FOUND behave we can't to use RETURN QUERY for following pattern
> >
> > RETURN QUERY some;
> > IF FOUND THEN RETURN; END IF;
> > RETURN QUERY some_other;
> > RETURN;
>
> +1. I can't imagine it's good for this to be randomly inconsistent.

So should this be applied or just kept for 8.5?

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Robert Haas 2009-02-04 19:44:51 Re: [HACKERS] BUG #4516: FOUND variable does not work after RETURN QUERY
Previous Message Marshall, Steve 2009-02-03 19:43:25 Re: pg_listener entries deleted under heavy NOTIFY load only on Windows

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-02-04 18:38:47 Re: add_path optimization
Previous Message Simon Riggs 2009-02-04 18:25:31 Re: Hot standby, recovery infra