Re: [SQL] RULE questions. - Mailing list pgsql-hackers

From D'Arcy" "J.M." Cain
Subject Re: [SQL] RULE questions.
Date
Msg-id m10AvIi-0000c1C@druid.net
Whole thread Raw
Responses Re: [HACKERS] Re: [SQL] RULE questions.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Thus spake Neil Burrows
> First off, is there an easier way to ensure that data is stored in uppercase
> for certain columns (not the whole table).  And if not does anyone have
> comments on performance issues, or ways of stopping users accidentally or
> intentionally inserting lower case data straight into the table rather than
> the view?

This makes me think of two features missing in PostgreSQL that I would
love to see.  I know it's probably to late to think about it now for
6.5 but I wonder what others think about this.

First, as suggested above, how about an option to automatically convert
data to upper case on entry?  I realize that triggers can do the job but
it seems to be needed often enough that putting it into the definition
for the field seems useful.  I guess a lower option would make sense too.

Second, an option to CREATE INDEX to make the index case insensitive.
Other RDBMS systems do this and it is nice not to depend on users being
consistent when entering names.  Consider ("albert", "Daniel", "DENNIS")
which would sort exactly opposite.  Also, in a primary key field (or
unique index) it would be nice if "A" was rejected if "a" already was
in the database.

Thoughts?

Followups to hackers.

--
D'Arcy J.M. Cain <darcy@{druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 424 2871     (DoD#0082)    (eNTP)   |  what's for dinner.

pgsql-hackers by date:

Previous
From: jwieck@debis.com (Jan Wieck)
Date:
Subject: Re: [HACKERS] TIME QUALIFICATION
Next
From: "D'Arcy" "J.M." Cain
Date:
Subject: PQsocket