Re: Uppercase to lowercase trigger?

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Uppercase to lowercase trigger?
Date: 2012-05-13 10:39:36
Message-ID: joo318$jef$1@reversiblemaps.ath.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2012-05-03, Chrishelring <christianhelring(at)gmail(dot)com> wrote:
> Maybe I should clarify what I mean.
>
> I have a db (postgresql 8.4.1 with a postGIS spatial extension) with about
> 200+ tables in it. Some of them is supposed to be updated using an
> application what requres that some of the columns are in uppercase (a
> leftover from Oracle I suppose) but the main application that uses these
> tables requres that the columns are in lowercase. I had an idea that using a
> trigger I could chance the columns from lowercase to uppercase before
> updating /changing the tables and after the update chance them back to
> lowercase. Is that possible and how do I do that?

No, you could try fashioning an updatable view in a different schema
and exploiting schema search path such the main application sees one
version and the legacy application sees the other.

this means writing a view to handle selects, and do instead rules for
updates and deletes.

shema search path can be defaulted on a per-user basis so if one of
the applications always uses a distincr username for the databse
connection this can be implemented in a way that's transparent

--
⚂⚃ 100% natural

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Evan Martin 2012-05-13 13:59:04 Re: Why is RELEASE SAVEPOINT sometimes slow?
Previous Message Jasen Betts 2012-05-13 03:35:36 Re: Move the postgreSQL database from Drive C to Map Network Drive (Called Z)