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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

need trigger help



Hi All,

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

I have a table:

CREATE TABLE 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"
"name2"
"  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:
"name1"
"name2"
"name3"
"name4"
"name5"


Is that possible?

TIA






Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group