pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedUpper / lower cases on table and column names
3+ messages / 3 participants
[nested] [flat]
* Upper / lower cases on table and column names
@ 2002-10-25 12:16 Reiner Dassing <dassing@wettzell.ifag.de>
0 siblings, 2 replies; 3+ messages in thread
From: Reiner Dassing @ 2002-10-25 12:16 UTC (permalink / raw)
To: pgsql-sql
(PostgreSQL) 7.1.1:
Hello all!
I was trying to adopt a database application to PostgreSQL.
(It is written for MySQL and Oracle using perl)
During this process I recognized the phenomena that upper case letters
of table names and column names are not preserved
in PostgreSQL.
Is this a "featue" of PostgreSQL or do I miss something?
Example:
Id and textId as a column name should conserve upper case letters 'I'
but \d data converts it to lower case words:
psql ...
create table data ( Id int not null, textId int not null);
\d data
Table "data"
Attribute | Type | Modifier
-----------+---------+----------
id | integer | not null
textid | integer | not null
and
create table Data ( Id int not null, textId int not null);
results in:
ERROR: Relation 'data' already exists
In the interpretation of my application table 'data' and 'Data' is something
different.
--
--
Mit freundlichen Gruessen / With best regards
Reiner Dassing
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Upper / lower cases on table and column names
@ 2002-10-25 12:48 Stephan Szabo <sszabo@megazone23.bigpanda.com>
parent: Reiner Dassing <dassing@wettzell.ifag.de>
1 sibling, 0 replies; 3+ messages in thread
From: Stephan Szabo @ 2002-10-25 12:48 UTC (permalink / raw)
To: Reiner Dassing <dassing@wettzell.ifag.de>; +Cc: pgsql-sql
On Fri, 25 Oct 2002, Reiner Dassing wrote:
> I was trying to adopt a database application to PostgreSQL.
> (It is written for MySQL and Oracle using perl)
>
> During this process I recognized the phenomena that upper case letters
> of table names and column names are not preserved
> in PostgreSQL.
> Is this a "featue" of PostgreSQL or do I miss something?
There's some question about whether it should instead fold to upper
case, but in any case its a sort of cheat to handle the case
insensitivity of regular identifiers.
> create table data ( Id int not null, textId int not null);
> create table Data ( Id int not null, textId int not null);
>
> results in:
> ERROR: Relation 'data' already exists
>
> In the interpretation of my application table 'data' and 'Data' is something
> different.
AFAICT it shouldn't be. SQL92 basically says that two regular identifiers
are the equivalent if the identifer bodies compare equally. The
identifier bodies of a regular identifier are equivalent to an identifier
body in which each lower-case character is replaced with an upper case
one.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Upper / lower cases on table and column names
@ 2002-10-25 12:51 Achilleus Mantzios <achill@matrix.gatewaynet.com>
parent: Reiner Dassing <dassing@wettzell.ifag.de>
1 sibling, 0 replies; 3+ messages in thread
From: Achilleus Mantzios @ 2002-10-25 12:51 UTC (permalink / raw)
To: Reiner Dassing <dassing@wettzell.ifag.de>; +Cc: pgsql-sql
On Fri, 25 Oct 2002, Reiner Dassing wrote:
> (PostgreSQL) 7.1.1:
>
> Hello all!
>
> I was trying to adopt a database application to PostgreSQL.
> (It is written for MySQL and Oracle using perl)
>
> During this process I recognized the phenomena that upper case letters
> of table names and column names are not preserved
> in PostgreSQL.
> Is this a "featue" of PostgreSQL or do I miss something?
Both :)
You may double quote the literals of names in pgsql,
but then in every statement you must retain the double quotes,
which is annoying.
Change the table name to something more meaningful.
>
> Example:
> Id and textId as a column name should conserve upper case letters 'I'
> but \d data converts it to lower case words:
>
> psql ...
> create table data ( Id int not null, textId int not null);
>
> \d data
> Table "data"
> Attribute | Type | Modifier
> -----------+---------+----------
> id | integer | not null
> textid | integer | not null
>
> and
> create table Data ( Id int not null, textId int not null);
>
> results in:
> ERROR: Relation 'data' already exists
>
> In the interpretation of my application table 'data' and 'Data' is something
> different.
>
> --
> --
> Mit freundlichen Gruessen / With best regards
> Reiner Dassing
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>
==================================================================
Achilleus Mantzios
S/W Engineer
IT dept
Dynacom Tankers Mngmt
Nikis 4, Glyfada
Athens 16610
Greece
tel: +30-10-8981112
fax: +30-10-8981877
email: achill@matrix.gatewaynet.com
mantzios@softlab.ece.ntua.gr
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2002-10-25 12:51 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-10-25 12:16 Upper / lower cases on table and column names Reiner Dassing <dassing@wettzell.ifag.de>
2002-10-25 12:48 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
2002-10-25 12:51 ` Achilleus Mantzios <achill@matrix.gatewaynet.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox