Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id B19556329AA for ; Thu, 10 Dec 2009 14:09:28 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 07229-03 for ; Thu, 10 Dec 2009 18:09:21 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 330F5632419 for ; Thu, 10 Dec 2009 14:09:21 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id nBAI9JUp025984; Thu, 10 Dec 2009 13:09:19 -0500 (EST) To: Harald Fuchs cc: pgsql-sql@postgresql.org Subject: Re: Window function trouble In-reply-to: References: Comments: In-reply-to Harald Fuchs message dated "Thu, 10 Dec 2009 18:49:57 +0100" Date: Thu, 10 Dec 2009 13:09:19 -0500 Message-ID: <25983.1260468559@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200912/29 X-Sequence-Number: 33467 Harald Fuchs writes: > Apparently the CASE expression is named "adr" unless named > otherwise, and the result set is sorted by this expression instead of > the column named "adr". Does anyone know what the SQL standard says > about that? The SQL standard says the default name for any output column other than a simple column reference is implementation-dependent. I think our implementation involves looking at the default value for a CASE. regards, tom lane