Sascha Alexander Jopen wrote:
> Hi there,
> I'm new to PHP, especially to the db-functions.
> I've got a problem querying my PostgreSQL server using pg_query.
> The Tables i'm working on contain colume names with uppercase letters.
> Working on those tables directly with psql, the client program delivered
> with postgresql, works like expected. Its case-sensitive, so you have to
> specify the table names with the correct case of the letters. But pg_quer
> seems to convert all queries into lowercase.

This is normal. PostgreSQL does not distingish case and stores most
names as lowercase and convert names to lowerc case. You can keep case
also. Read PostgreSQL manual for detials.

> A query like: INSERT INTO users (UsrLoginName, UsrPassword) VALUES ...
> results in an errormessage like: PHP Warning:  pg_query() query failed:
> ERROR:  Relation 'users' does not have attribute 'usrloginname' ...
> What did i do wrong? Or is it a problem with the postgresql db-package of
> PHP?

Because there is no 'usrloginname'?

> I think, if the backend is case-sensitive, PHP's functions should be
> case-sensitiv, too!

I like case sensitive language, but PHP is not. You have to
live with it.

> Please don't tell me to convert all tables/colums to lowercase!

Read PostgreSQL manual, then you should be able to find info needed.

test=# create table ttt ("ThisIsNumber" int);
test=# \d ttt
             Table "ttt"
     Column    |  Type   | Modifiers
  ThisIsNumber | integer |

test=# create table tttt (ThisIsNumber int);
test=# \d tttt
             Table "tttt"
     Column    |  Type   | Modifiers
  thisisnumber | integer |


Yasuo Ohgaki

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to