Re: [SQL] id and ID in CREATE TABLE

Поиск
Список
Период
Сортировка
От Christopher Kings-Lynne
Тема Re: [SQL] id and ID in CREATE TABLE
Дата
Msg-id GNELIHDDFBOCMGBFGEFOMEDKCDAA.chriskl@familyhealth.com.au
обсуждение исходный текст
Ответ на id and ID in CREATE TABLE  (stefan@extum.com)
Список pgsql-general
> 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


В списке pgsql-general по дате отправления:

Предыдущее
От: "Christian Lübeck"
Дата:
Сообщение: References for PostgreSQL
Следующее
От: Steve Brett
Дата:
Сообщение: Re: References for PostgreSQL