From: Tom Lane <tgl@sss.pgh.pa.us>
To: Christoph Haller <ch@rodos.fzk.de>
Cc: sgnerd@yahoo.com.sg
Cc: pgsql-sql@postgresql.org
Subject: Re: Using UNION inside a cursor
Date: Thu, 30 Oct 2003 10:20:27 -0500
Message-ID: <28146.1067527227@sss.pgh.pa.us> (raw)
In-Reply-To: <200310300926.KAA04661@rodos>
References: <200310300926.KAA04661@rodos>
Christoph Haller <ch@rodos.fzk.de> writes:
>> OPEN ref FOR
>> (SELECT * FROM history WHERE obs_type =3D \'AA\' )
>> UNION
>> (SELECT * FROM history WHERE obs_type =3D \'TA\');
> My suspicion is the plpgsql parser doesn't accept the opening
> parenthesis.
Yeah. Looking at the plpgsql grammar, it expects the token after FOR to
be either SELECT or EXECUTE. This example demonstrates that that code
is wrong, so I'll fix it for 7.4. But in the meantime, why don't you
just leave out the parentheses?
regards, tom lane
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, ch@rodos.fzk.de, sgnerd@yahoo.com.sg
Subject: Re: Using UNION inside a cursor
In-Reply-To: <28146.1067527227@sss.pgh.pa.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