Re: [HACKERS] Re: [SQL] RULE questions.

From: Hannu Krosing <hannu(at)trust(dot)ee>
To: pgsql-hackers(at)postgreSQL(dot)org
Cc: Neil Burrows <maillist(at)remo(dot)demon(dot)co(dot)uk>, pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Re: [SQL] RULE questions.
Date: 1999-02-11 17:39:47
Message-ID: 36C315E3.24CD16C3@trust.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

D'Arcy J.M. Cain wrote:
>
> 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.

These could probably be implemened more effectively using rules. Having
the
rules generated automatically for simple cases would of course be nice,
but a warning at least should be given to user about creating the rule,
like it's currently done with primary key.

Or maybe it would be better to support virtual fields, like this :

create table people(
first_name varchar(25),
last_name varchar(25),
upper_first_name VIRTUAL upper(first_name),
upper_last_name VIRTUAL upper(last_name),
full_name VIRTUAL (upper_first_name || ' ' || upper_last_name)
primary key
);

and then untangle this in the backend and create required rules and
indexes automatically ?

> Second, an option to CREATE INDEX to make the index case insensitive.

If you have this option on idex, how do you plan to make sure that the
index is actually used ?

It may be better to do it explicitly -

1. create index on upper(field)

2. use where upper(field) = 'MYDATA'

---------------
Hannu

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 1999-02-11 18:01:49 Re: [HACKERS] Re: [SQL] RULE questions.
Previous Message Thomas G. Lockhart 1999-02-11 17:38:12 Re: [HACKERS] date_part() BUG?

Browse pgsql-sql by date

  From Date Subject
Next Message Jan Wieck 1999-02-11 18:01:49 Re: [HACKERS] Re: [SQL] RULE questions.
Previous Message Tom Lane 1999-02-11 15:35:00 Re: [HACKERS] Re: [SQL] RULE questions.