how to do a find and replace

From: Dawn Buie <dawn(at)squeegeemedia(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: how to do a find and replace
Date: 2005-11-17 23:47:41
Message-ID: 5d001d303f001ea0847254c3f0a352d9@squeegeemedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello-
I'm using postgres 7.4

I have a column of data with the wrong prefix for many items.

The wrong entries are entered ' /0/v.myimage.jpg'
While the correct ones are ' /0/myimage.jpg'

I need to remove all the 'v.' characters from this column.

I'm able to do a

SELECT * FROM myTable
WHERE location = '%/0/v.%'

I'm just confused about how I should write code to update the selected
items to remove the 'v.'

Would I use substring? An example would be much appreciated.

thank you
Dawn

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Bricklen Anderson 2005-11-17 23:55:14 Re: how to do a find and replace
Previous Message codeWarrior 2005-11-17 23:35:48 Re: timestamp SQL question