Re: removing leading and trailing blanks from every row in a table

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: removing leading and trailing blanks from every row in a table
Date: 2009-01-25 00:39:09
Message-ID: glgcbd$4t1$10@reversiblemaps.ath.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On 2009-01-21, Wm.A.Stafford <stafford(at)marine(dot)rutgers(dot)edu> wrote:
> I need a procedure to remove leading and trailing blanks from column of
> every row in a table. I would like to pass the table name as a
> parameter and have the procedure do the rest. Does something like this
> already exist? Is it even possible?

the sql to do this is

UPDATE tablename SET columnname=TRIM( columnname );

Do you really need a function?

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Jasen Betts 2009-01-25 01:05:52 Re: SQL Question: Averages of intervals.
Previous Message Daniel Staal 2009-01-24 18:19:48 Re: SQL Question: Averages of intervals.