Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 95F3E9FA4F0 for ; Fri, 5 Jan 2007 01:41:09 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 55776-04-3 for ; Fri, 5 Jan 2007 01:40:46 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 192AB9FA621 for ; Fri, 5 Jan 2007 01:28:54 -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 l055SqxI010252; Fri, 5 Jan 2007 00:28:52 -0500 (EST) To: Ken Johanson cc: pgsql-jdbc@postgresql.org, Kris Jurka Subject: Re: Support for DatabaseMetadata: getCatalogName, getTableName, In-reply-to: <459D7D66.6010202@kensystem.com> References: <4594B16C.5010609@kensystem.com> <3936D281-E235-4FB3-889E-08981ABB0954@fastcrypt.com> <459D3487.6080202@kensystem.com> <459D3F3E.5040006@kensystem.com> <459D6CEC.9040505@kensystem.com> <459D7D66.6010202@kensystem.com> Comments: In-reply-to Ken Johanson message dated "Thu, 04 Jan 2007 15:19:18 -0700" Date: Fri, 05 Jan 2007 00:28:52 -0500 Message-ID: <10251.1167974932@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200701/37 X-Sequence-Number: 16402 Ken Johanson writes: > Kris Jurka wrote: >> The previous discussion I cited was referring to getColumnName and how >> it really should be referring to the alias of a result, not the column >> itself. That is for "SELECT a AS b FROM c AS d" should return "b" for >> getColumnName(1). If we accept that as true then it follows that >> getTableName(1) should return "d", not "c". > Understood now, thanks. I agree/vote this is the best spec > interpretation/behavior (for its lack of a 'getTableLabel'). Urm ... I might agree with that, except for its signal lack of usefulness. What is the point of knowing the table alias? The underlying-table-and-column names have some possible usefulness for issuing updates against the underlying tables, but what the heck are you going to do with "d" here? If the application understands the query (which it itself issued, don't forget) well enough to understand what "d" conveys, why wouldn't "b" be at least as useful? I think you're letting a narrow reading of some admittedly-badly-written spec text get the best of you. regards, tom lane