Re: Uppercase to lowercase trigger?

From: Ken Tanzer <ken(dot)tanzer(at)gmail(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Chrishelring <christianhelring(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Uppercase to lowercase trigger?
Date: 2012-05-03 07:50:07
Message-ID: CAD3a31WqQC0zKFjh_HzHrOUiNDBy3n_5s_-fAVeAJ-MMgeD5xw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

What if you created separate tables with the fields in uppercase, either
with different names or better yet the same names and a different schema?
It seems you could put triggers on those tables, and have your trigger
translate the field names and make the updates to the real tables instead.

Seems like a lot of work, though, that could be avoided if you could get
your app to drop the quoting of field names, and have it automatically fold
to lower case...

On Thu, May 3, 2012 at 12:41 AM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>wrote:

> Hello
>
> 2012/5/3 Chrishelring <christianhelring(at)gmail(dot)com>:
> > 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, this is not possible. But you can write simple functions that
> verifies names and you can call this function manually when you do
> some changes, or you can call this function from cron.
>
> Regards
>
> Pavel Stehule
>
>
> >
> > Christian
> >
> > --
> > View this message in context:
> http://postgresql.1045698.n5.nabble.com/Uppercase-to-lowercase-trigger-tp5680384p5682473.html
> > Sent from the PostgreSQL - general mailing list archive at Nabble.com.
> >
> > --
> > Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> > To make changes to your subscription:
> > http://www.postgresql.org/mailpref/pgsql-general
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

--
AGENCY Software
A data system that puts you in control
*http://agency-software.org/*
ken(dot)tanzer(at)agency-software(dot)org
(253) 245-3801

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2012-05-03 07:56:05 Re: Uppercase to lowercase trigger?
Previous Message Pavel Stehule 2012-05-03 07:41:31 Re: Uppercase to lowercase trigger?