From: Bruce Momjian <bruce@momjian.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: David Fetter <dfetter@vmware.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #6067: In PL/pgsql, EXISTS(SELECT ... INTO...) fails
Date: Thu, 16 Aug 2012 21:32:03 -0400
Message-ID: <20120817013203.GO30286@momjian.us> (raw)
In-Reply-To: <CA+TgmoZC9vwRD0rJVFE5rG4HtWQCZ9S9WSHb8nHyRBDtsPUQ2Q@mail.gmail.com>
References: <24370.1308429051@sss.pgh.pa.us>
<201111300232.pAU2WgS10262@momjian.us>
<CA+TgmoZC9vwRD0rJVFE5rG4HtWQCZ9S9WSHb8nHyRBDtsPUQ2Q@mail.gmail.com>
On Wed, Nov 30, 2011 at 03:36:11PM -0500, Robert Haas wrote:
> On Tue, Nov 29, 2011 at 9:32 PM, Bruce Momjian <bruce@momjian.us> wrote:
> > Tom Lane wrote:
> >> "David Fetter" <dfetter@vmware.com> writes:
> >> > IF EXISTS (SELECT 1 INTO STRICT i) THEN
> >> > RAISE NOTICE '%', a;
> >> > END IF;
> >>
> >> Umm ... are you just complaining that the error message isn't very
> >> helpful, or are you actually expecting that to do something useful?
> >> If the latter, what exactly? I'm particularly confused by your use
> >> of the STRICT option here, because if we did support that, I would
> >> expect the STRICT to throw an error if there were not exactly one
> >> matching row, making the EXISTS test 100% pointless.
> >>
> >> But the short answer is that we don't support INTO in sub-selects,
> >> and in general I doubt that we ever will, since in most cases the
> >> behavior wouldn't be very well-defined. It might be worth a TODO
> >> to provide a better error message than "syntax error", though.
> >
> > Is it worth documenting, fixing, or adding this to the TODO list?
>
> At most I would say we could try to improve the error message.
I researched this and it seems to complex to improve the error message.
I am afraid it would have to bleed into the main backend parser.
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ It's impossible for everything to be true. +
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: bruce@momjian.us, robertmhaas@gmail.com, tgl@sss.pgh.pa.us, dfetter@vmware.com
Subject: Re: BUG #6067: In PL/pgsql, EXISTS(SELECT ... INTO...) fails
In-Reply-To: <20120817013203.GO30286@momjian.us>
References: <24370.1308429051@sss.pgh.pa.us> <201111300232.pAU2WgS10262@momjian.us> <CA+TgmoZC9vwRD0rJVFE5rG4HtWQCZ9S9WSHb8nHyRBDtsPUQ2Q@mail.gmail.com> <20120817013203.GO30286@momjian.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox