Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id F3E789FB8E7 for ; Mon, 5 Mar 2007 10:28:31 -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 65288-07 for ; Mon, 5 Mar 2007 10:28:21 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by postgresql.org (Postfix) with SMTP id 1C6129FB8D7 for ; Mon, 5 Mar 2007 10:28:26 -0400 (AST) Received: (qmail 24580 invoked from network); 5 Mar 2007 14:28:25 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.14?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 5 Mar 2007 14:28:25 -0000 In-Reply-To: <20070304141231.351EE14D8C7@smtp-2.sys.kth.se> References: <20070304141231.351EE14D8C7@smtp-2.sys.kth.se> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <7A264DB4-E545-43A9-AF6F-BBD16FE5D6C0@fastcrypt.com> Cc: Content-Transfer-Encoding: 7bit From: Dave Cramer Subject: Re: Switching from MySQL to PostgreSQL, JDBC drivers behaving differently Date: Mon, 5 Mar 2007 09:28:31 -0500 To: Matthias Karlsson X-Mailer: Apple Mail (2.752.3) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200703/26 X-Sequence-Number: 16740 Matthias, On 4-Mar-07, at 9:12 AM, Matthias Karlsson wrote: > Hi, > > I originally had a much longer mail written describing in detail > why I had a > problem with my current framework, but I decided to go with a simple > question instead :) > > If I submit the following query to PostgreSQL: > > select a.*, b.* from A a > inner join B b on b.id = a.b_id > > where (for instance) both A and B have a column named 'name', is it > possible > to distinguish between the two without using explicit positioning > with the > JDBC interface? That is, with the MySQL driver, I can write: > > rs.getString("a.name") and rs.getString("b.name"), but this doesn't > seem to > work with PostgreSQL. That's correct it does not work with postgresql. This is why hibernate,and other persistence layers explicitly name their columns. Dave > > Sincerely, > Matthias Karlsson > > > ---------------------------(end of > broadcast)--------------------------- > TIP 6: explain analyze is your friend >