Re: The empty list?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jesper Krogh <jesper(at)krogh(dot)cc>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: The empty list?
Date: 2006-11-02 22:34:23
Message-ID: 21991.1162506863@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Jesper Krogh <jesper(at)krogh(dot)cc> writes:
> Whereas this gives a syntax error:

> # select 1 in ();
> ERROR: syntax error at or near ")" at character 14
> LINE 1: select 1 in ();
> ^

If we took that syntax it would probably mean a zero-element row,
not an empty IN list. But I'm disclined to allow either, as it'd
seem entirely too likely to convert plain old typos into queries
the system will think are valid ...

I think the short answer why the spec disallows this (which it does)
is that it considers the right-hand side to be a table, and with
absolutely nothing there, there is no way to impute a rowtype to the
table.

regards, tom lane

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Chris Browne 2006-11-02 22:41:46 Re: Database recovery in postgres 7.2.4.
Previous Message Jesper Krogh 2006-11-02 21:38:19 The empty list?