select exists (select oid from users)

From: The Hermit Hacker <scrappy(at)hub(dot)org>
To: pgsql-hackers(at)postgresql(dot)org
Subject: select exists (select oid from users)
Date: 2000-03-01 03:17:37
Message-ID: Pine.BSF.4.21.0002292316110.434-100000@thelab.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


==============================
From: Don Baccus <dhogaza(at)pacifier(dot)com>

The query "select exists (select oid from users)" is very
non-standard and I'm surprised it works. I can accept that
some very weird queries might mess up PL/pgSQL, but it would
be nice if the backend wouldn't crash.

Again, PG7.0 beta (actually, a snapshot taken four days earlier,
I've given up on the official beta for the time being)

acs=# select exists (select oid from users);
?column?
----------
t
(1 row)

acs=# create function foo(integer) returns boolean as '
acs'# begin
acs'# return exists (select oid from users);
acs'# end;' language 'plpgsql';
CREATE
acs=# select foo(3);
pqReadData() -- backend closed the channel unexpectedly.
This probably means the backend terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
!# \q
[acs(at)gyrfalcon acs]$ psql
Welcome to psql, the PostgreSQL interactive terminal.
...
acs=# create function bar(integer) returns boolean as '
acs'# begin
acs'# return ''t'' where exists (select oid from users);
acs'# end;' language 'plpgsql';
CREATE
acs=# select bar(3);
bar
-----
t
(1 row)

- Don Baccus, Portland OR <dhogaza(at)pacifier(dot)com>
Nature photos, on-line guides, Pacific Northwest
Rare Bird Alert Service and other goodies at
http://donb.photo.net.

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Sawtell 2000-03-01 03:26:24 Re: [HACKERS] Re: [SQL] prob with aggregate and group by - returns multiplesh
Previous Message Bruce Momjian 2000-03-01 02:42:00 Re: [HACKERS] Bug report for 7.0beta1 in 'CREATE FUNCTION...'