Re: Uppercase to lowercase trigger?

From: Chris Angelico <rosuav(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Uppercase to lowercase trigger?
Date: 2012-05-02 16:30:20
Message-ID: CAPTjJmqvsdMuaWnkbL5QtOofBfPY_tMSGcU2LKfmcvioXw_XyQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, May 2, 2012 at 10:33 PM, Chrishelring
<christianhelring(at)gmail(dot)com> wrote:
> Hi,
>
> I´ve got some tables with column names in lowercase. Before updatering these
> tables I want to add a trigger that can convert these lowercase to
> uppercase, and when the tables are updates convert them back to lowercase..

Not entirely sure what you're looking for here, but in Postgres, if
you don't quote your column names, they are lowercased by default.

UPDATE some_table SET ColumnName = 'foo', COLUMNNAME2 = 'bar';

This will work if the table has "columnname" and "columnname2".

ChrisA

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2012-05-02 16:31:02 Removal of BSDi, BSD/OS port
Previous Message leaf_yxj 2012-05-02 16:14:52 How to insert random character data into tables for testing purpose. THanks.