Re: [SQL] id and ID in CREATE TABLE

From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: <stefan(at)extum(dot)com>, <pgsql-sql(at)postgresql(dot)org>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: [SQL] id and ID in CREATE TABLE
Date: 2002-07-19 06:55:09
Message-ID: GNELIHDDFBOCMGBFGEFOMEDKCDAA.chriskl@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

> Can somebody explain me a bit about:
>
> 1. As far as I know column names in Tables are not case
> sensitive. Correct ?
> So I know if I pickup ID is not a clever idea but for this
> example it is ok.

I think your examples have proved that column names are in fact very much
case sensitive. However, you will need to double quote mixed case names:

eg. SELECT "ID" FROM ttt2;

> As well if I have name and Name it should not matter for SQL.

Well it does in Postgresql. I highly recommend you just use lowercase field
names.

> 2. Why psql converts from upper case in lower case column name ID ?
> Like in the first case.

Because you didn't double quote it.

> 3. How comes that first using psql I cannot create the column name ID but
> using pgaccess I can ? Is this a bug ?

Because pgaccess is doing the double quoting for you.

Chris

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Curt Sampson 2002-07-19 07:05:08 Re: Bad HTML in Mail List Archives
Previous Message Adrian 'Dagurashibanipal' von Bidder 2002-07-19 06:44:56 Re: PostgreSQL vs. SapDB slashdot discussion

Browse pgsql-sql by date

  From Date Subject
Next Message Martijn van Oosterhout 2002-07-19 07:20:11 Re: id and ID in CREATE TABLE
Previous Message Charitha 2002-07-19 06:31:44 Regarding replication