Case problem

Started by Josh Samuelsover 24 years ago5 messagesgeneral
Jump to latest
#1Josh Samuels
loadexfa@home.com

I have tables with different case in them, for example Customers and
CustomerID is a column in that table. When I try to access the table or
column in either a php script or psql is converts everything to lowercase
and then I can't use them...why! Doesn't Postgres support case? I can't
read my code if everything is in lowercase. Thank you in advance.

Josh

#2MacMac
Macias@box43.pl
In reply to: Josh Samuels (#1)
Re: Case problem

Try with " , ie: "CustomerID"

MacMac

U�ytkownik "Josh Samuels" <loadexfa@home.com> napisa� w wiadomo�ci
news:IIQA7.53226$8a.34976615@news1.rsm1.occa.home.com...

Show quoted text

I have tables with different case in them, for example Customers and
CustomerID is a column in that table. When I try to access the table or
column in either a php script or psql is converts everything to lowercase
and then I can't use them...why! Doesn't Postgres support case? I can't
read my code if everything is in lowercase. Thank you in advance.
Josh

#3Josh Samuels
loadexfa@home.com
In reply to: Josh Samuels (#1)
Re: Case problem

Thank you. That did it.
Josh
"MacMac" <Macias@box43.pl> wrote in message news:3bd43e8b@news.vogel.pl...

Try with " , ie: "CustomerID"

MacMac

U�ytkownik "Josh Samuels" <loadexfa@home.com> napisa� w wiadomo�ci
news:IIQA7.53226$8a.34976615@news1.rsm1.occa.home.com...

I have tables with different case in them, for example Customers and
CustomerID is a column in that table. When I try to access the table or
column in either a php script or psql is converts everything to

lowercase

and then I can't use them...why! Doesn't Postgres support case? I

can't

Show quoted text

read my code if everything is in lowercase. Thank you in advance.
Josh

#4Stephan Szabo
sszabo@megazone23.bigpanda.com
In reply to: Josh Samuels (#1)
Re: Case problem

On Mon, 22 Oct 2001, Josh Samuels wrote:

I have tables with different case in them, for example Customers and
CustomerID is a column in that table. When I try to access the table or
column in either a php script or psql is converts everything to lowercase
and then I can't use them...why! Doesn't Postgres support case? I can't
read my code if everything is in lowercase. Thank you in advance.

If you want to use mixed case names place them in double quotes and
postgres will leave the case the same. However, you'll always need to
use the double quotes in order to find the tables/columns/etc...

#5Markus Meyer
meyer@mesw.de
In reply to: Josh Samuels (#1)
Re: Case problem

Hey Josh,

I have tables with different case in them, for example Customers and
CustomerID is a column in that table. When I try to access the table or
column in either a php script or psql is converts everything to lowercase
and then I can't use them...why! Doesn't Postgres support case? I can't
read my code if everything is in lowercase. Thank you in advance.

Try using '"' around the names:

SELECT * FROM "Customers" WHERE "CustomerID" = 42;

Markus