Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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.



pgsql-hackers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group