pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dave Cramer <pg@fastcrypt.com>
To: Matthias Karlsson <mc@kth.se>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Switching from MySQL to PostgreSQL, JDBC drivers behaving differently
Date: Mon, 5 Mar 2007 09:28:31 -0500
Message-ID: <7A264DB4-E545-43A9-AF6F-BBD16FE5D6C0@fastcrypt.com> (raw)
In-Reply-To: <20070304141231.351EE14D8C7@smtp-2.sys.kth.se>
References: <20070304141231.351EE14D8C7@smtp-2.sys.kth.se>

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
>




view thread (2+ messages)

Message-ID: <7A264DB4-E545-43A9-AF6F-BBD16FE5D6C0@fastcrypt.com>
Permalink:  ../7A264DB4-E545-43A9-AF6F-BBD16FE5D6C0@fastcrypt.com/
Also on:    postgresql.org/message-id/7A264DB4-E545-43A9-AF6F-BBD16FE5D6C0@fastcrypt.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: pg@fastcrypt.com, mc@kth.se
  Subject: Re: Switching from MySQL to PostgreSQL, JDBC drivers behaving differently
  In-Reply-To: <7A264DB4-E545-43A9-AF6F-BBD16FE5D6C0@fastcrypt.com>
  References: <20070304141231.351EE14D8C7@smtp-2.sys.kth.se> <7A264DB4-E545-43A9-AF6F-BBD16FE5D6C0@fastcrypt.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox