Received: from localhost (pluto.hub.org [200.46.204.4]) by postgresql.org (Postfix) with ESMTP id 6C1909FA646 for ; Thu, 2 Nov 2006 18:34:28 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.4]) (amavisd-new, port 10024) with ESMTP id 92792-09 for ; Thu, 2 Nov 2006 18:34:23 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id B156A9FA5F0 for ; Thu, 2 Nov 2006 18:34:26 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id kA2MYNGj021992; Thu, 2 Nov 2006 17:34:23 -0500 (EST) To: Jesper Krogh cc: pgsql-sql@postgresql.org Subject: Re: The empty list? In-reply-to: <454A654B.2000306@krogh.cc> References: <454A654B.2000306@krogh.cc> Comments: In-reply-to Jesper Krogh message dated "Thu, 02 Nov 2006 22:38:19 +0100" Date: Thu, 02 Nov 2006 17:34:23 -0500 Message-ID: <21991.1162506863@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/21 X-Sequence-Number: 26673 Jesper Krogh 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