Re: [HACKERS] INTERSECT in gram.y again

From: Michael Meskes <Michael(dot)Meskes(at)usa(dot)net>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] INTERSECT in gram.y again
Date: 1999-01-23 12:27:36
Message-ID: 19990123132736.A3678@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jan 22, 1999 at 02:34:52PM -0500, Bruce Momjian wrote:
> As far as I can tell, The 'else' part of the query only gets executed in
> the case of UNION, EXCEPT, or INTERCEPT. Because FOR UPDATE is invalid
> in all these cases, the intersectClause being non-NULL is an OK test,

You're right of course.

> though, as you point out, it is not accurate. I have modified gram.y to
> check just for unionClause:
>
> if (n->unionClause != NULL)
> elog(ERROR, "SELECT FOR UPDATE is not allowed with UNION/INTERSECT/EXCEPT claus$

But isn't the pure existance of for update enough to have an error in the
else branch?

And can't we get the same error in the if branch as well with a having
clause or something like that?

Michael

--
Michael Meskes | Go SF 49ers!
Th.-Heuss-Str. 61, D-41812 Erkelenz | Go Rhein Fire!
Tel.: (+49) 2431/72651 | Use Debian GNU/Linux!
Email: Michael(dot)Meskes(at)gmx(dot)net | Use PostgreSQL!

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message D'Arcy J.M. Cain 1999-01-23 12:42:19 Adding some const keywords to external interfaces
Previous Message Thomas G. Lockhart 1999-01-23 03:00:19 MySQL vulnerability