Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: case sensitivity on table & column names / workaround?



postgresql(dot)org(at)tgice(dot)com wrote:

The problem that causes me in my SQL on the PG side is that while I have
written it with the same capitalization, for readability, I don't put
double quotes on the identifiers, you know, because it's a pain in the ass.

Postgresql forces all sql to lower case unless you quote it (at creation time). Quoting forces the capitalization, and then you have to refer to it forever with quotes.

The long term solution would be to change the MS SQL side of things to use all lower case.

It's really a good idea on any db system to just use lower case for everything. Unless you are using Firebird or Interbase, then it works just the opposite of PG, it forces everything to
uppercase.

It must be the odbc driver doing the quoting because if you do the following in PG:

create table MyTestDB(
varchar(10) without oids;

postgresql creates it as mytestdb

if you do:

create table "MyTestDB"(
varchar(10) without oids;

Then the capitals stay and you must always reference the table like so:

select * from "MyTestDB"


--
Tony Caduto
AM Software Design
http://www.amsoftwaredesign.com
Home of PG Lightning Admin for Postgresql
Your best bet for Postgresql Administration



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group