Re: Table Names

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: Rob <rob(at)obsidian(dot)co(dot)za>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Table Names
Date: 2002-01-25 11:16:30
Message-ID: 1011957392.5475.15.camel@linda
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Fri, 2002-01-25 at 16:08, Rob wrote:
> I have a table name SYS_Keyword, but everytime I try to query it, postgres
> converts it to sys_keyword and then can't find it. Why does it do this
> and is there any way around it?

A table name is a SQL identifier; all identifiers are case-insensitive
unless they are enclosed in double quotes ("). So long as you are
consistent, there is no problem because all unquoted identifiers are
converted to lower case.

It seems that you must have created the table with quotes around its
name CREATE TABLE "SYS_Keyword" (...) ; therefore you must always now
refer to it as "SYS_Keyword" in order to be able to find it.

In general it is a good idea not to try to mix case in identifiers; it
only leads to confusion.
--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C

"My little children, let us not love in word, neither
in tongue; but in deed and in truth."
I John 3:18

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Jules Alberts 2002-01-25 11:20:11 Re: Table Names
Previous Message Frank Bax 2002-01-24 12:50:58 Re: Disk I/O