Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id B3A1C9FB7F8 for ; Thu, 15 Feb 2007 07:19:42 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 92530-10 for ; Thu, 15 Feb 2007 07:19:28 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.230]) by postgresql.org (Postfix) with ESMTP id 59B759FB6D2 for ; Thu, 15 Feb 2007 07:19:30 -0400 (AST) Received: by wr-out-0506.google.com with SMTP id i21so602061wra for ; Thu, 15 Feb 2007 03:19:29 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=cc6v9ceHW8zfSEmb42+MnfOWkgJz6oUIWXPk+OfZNG5lmw2K3d2Oxf8z93Xn2vlmCWyw0Vdi2vMqtuYTBFBkYCzdHzC2gHVvysnJpcVYkLe3IZ3RBF/jtFj558NLNC8XI8DfTb/eg8/n24g3JVi+zEVw3pD+Nteeq9b3bliRo1k= Received: by 10.114.93.1 with SMTP id q1mr892886wab.1171538368675; Thu, 15 Feb 2007 03:19:28 -0800 (PST) Received: by 10.114.13.17 with HTTP; Thu, 15 Feb 2007 03:19:28 -0800 (PST) Message-ID: <32cabba0702150319v427d5a25s9a6c7f851576baa2@mail.gmail.com> Date: Thu, 15 Feb 2007 09:19:28 -0200 From: "Walter Cruz" To: pgsql-sql@postgresql.org Subject: "for SELECT DISTINCT, ORDER BY expressions must appear in select list" - is that the standart or a limitation of postgresql? MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200702/162 X-Sequence-Number: 27496 CREATE TABLE test ( id int4 NOT NULL DEFAULT nextval('teste_id_seq'::regclass), name varchar, number int4 ) WITHOUT OIDS; The data: 1;"walter";1 2;"walter";1 3;"walter";1 4;"walter";1 5;"walter";2 6;"walter";3 7;"rodrigo";1 8;"rodrigo";2 9;"rodrigo";3 The query: SELECT distinct name from test order by number (well, I think that que query doesn't make any sense, but raises the error :) ) The error: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list is due to a standart implementarion or a design decision of postgres? The comentary on parse_clause.c looks like the second option. I'm right? []'s - Walter