The empty list?

From: Jesper Krogh <jesper(at)krogh(dot)cc>
To: pgsql-sql(at)postgresql(dot)org
Subject: The empty list?
Date: 2006-11-02 21:38:19
Message-ID: 454A654B.2000306@krogh.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi.

Is there someone who can elaborate on why the "empty list" is'nt
implemented in Postgresql?

This works:
# select 1 in (1,2,3);
?column?
----------
t
(1 row)

And this works:
jesper=# select * from test;
id
----
(0 rows)

jesper=# select 1 in (select id from test);
?column?
----------
f
(1 row)

Whereas this gives a syntax error:

# select 1 in ();
ERROR: syntax error at or near ")" at character 14
LINE 1: select 1 in ();
^
If everyone where writing their SQL by hand .. this would probably not
be a problem, but nowadays lots of people use ORM's for accessing the
database.. thus it would be nice if the SQL implementation was a bit
more generic like a "language".

Jesper
--
Jesper Krogh, jesper(at)krogh(dot)cc

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2006-11-02 22:34:23 Re: The empty list?
Previous Message Andreas Kretschmer 2006-11-02 20:49:04 Re: Is there anyway to...