Re: Switching from MySQL to PostgreSQL, JDBC drivers behaving differently

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Matthias Karlsson <mc(at)kth(dot)se>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Switching from MySQL to PostgreSQL, JDBC drivers behaving differently
Date: 2007-03-05 14:28:31
Message-ID: 7A264DB4-E545-43A9-AF6F-BBD16FE5D6C0@fastcrypt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Albe Laurenz 2007-03-05 14:35:41 Re: JDBC driver bug?
Previous Message Heikki Linnakangas 2007-03-05 11:43:13 Re: JDBC driver bug?