Re: capitals in fieldnames

From: Richard Huxton <dev(at)archonet(dot)com>
To: Markus Mohr <markus(at)johalla(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: capitals in fieldnames
Date: 2001-04-01 16:25:12
Message-ID: 3AC75667.1B78930D@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Markus Mohr wrote:
>
> Hi!
>
> I use postgres 7.0.3 on Linux and have the following problem:
> there is a field with the name 'BGF' and I can access it only with:
>
> SELECT "BGF" FROM <table>;
>
> Neither
>
> SELECT BGF ... nor
> SELECT bgf ...
>
> work. But AFAIK all three should do. Whats wrong here?

PostgreSQL lower-cases everything as it is used unless you put it in
double-quotes. The two examples should work if your field was 'bgf' -
you must have created it with double-quotes or imported it from another
system e.g. MS-Access.

It can be irritating, I agree and does make porting from Access more
difficult but I can't see it changing.

- Richard Huxton

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2001-04-01 16:27:16 Re: 7.0.X-> 7.1 dump/restore required?
Previous Message Richard Huxton 2001-04-01 16:20:02 Re: Need PostgreSQL startup scripts