Skip site navigation (1) Skip section navigation (2)

need trigger help

From: "Mag Gam" <magawake(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: need trigger help
Date: 2007-11-20 15:59:19
Message-ID: (view raw or whole thread)
Lists: pgsql-novice
Hi All,

I need some trigger help. I am very new to SQL, so please bare with me.

I have a table:

    id integer,
    name text,

Basically, I have values going into name.

The values that go into name are like this (being generated by a script),
without the quotes:
"    name1"
"  name3"
"    name4"
"name5   "

I want to write a trigger, for UPDATE/INSERT, do a ltrim and rtrim() of name
value. I want to remove all the beginning and ending blank spaces.

I want name to be like this:

Is that possible?



pgsql-novice by date

Next:From: Rodrigo De LeónDate: 2007-11-20 16:19:09
Subject: Re: need trigger help
Previous:From: Emil Oppeln-BronikowskiDate: 2007-11-20 07:08:27
Subject: Re: Database version control

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group