Re: Column names getting lower-case in SELECT statements when issued via JDBC

From: Jerry Sievers <gsievers19(at)comcast(dot)net>
To: "Eduardas F(dot)" <tcpa252(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Column names getting lower-case in SELECT statements when issued via JDBC
Date: 2011-05-15 19:26:08
Message-ID: 87ei3zsr3j.fsf@comcast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Eduardas F." <tcpa252(at)gmail(dot)com> writes:

> Hello everyone, today I encountered this nasty problem:
> Whenever you issue an SELECT command from JDBC (prepared statement) you end up with column X does not exist. And
> column X name is shown in?lower-case? As?I?understand,?PostgreSQL Server?or?PostgreSQL?JDBC driver converts column
> names containing?upper-case?letters to?lower-case? Is there an easy way to bypass this?behaviour? (Channing?column
> names is not an option).
>
> Here's an example of crashing SELECT:?"SELECT password, accessLevel, lastServer, userIP FROM accounts WHERE login=?"
> You end up with 'column "accesslevel" does not exist'.

If the field names are actually mixed case in the DB, then you need
double quotes around the names in the SQL statement.

What does \d for that table name tell you?

You would experience this problem using any client and not JDBC
specific.

> Thanks for help in advance.
>

--
Jerry Sievers
Postgres DBA/Development Consulting
e: gsievers19(at)comcast(dot)net
p: 305.321.1144

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Szymon Guz 2011-05-15 19:26:14 Re: Column names getting lower-case in SELECT statements when issued via JDBC
Previous Message Eduardas F. 2011-05-15 19:04:34 Column names getting lower-case in SELECT statements when issued via JDBC