incearca:
update _table_ set path=substring(path from 0 for position('path' in
path)) || 'new_path' || substring (path from position('path' in
path)+length('path') );


On Thu, 2004-01-22 at 15:02, Patrascu Eugeniu wrote:
> replace() merge se pare pe 7.4, pe 7.2 nu. pe 7.2 e vreo functie
> asemanatoare ?
> multumesc,
> 
> 
> On Thu, 2004-01-22 at 13:45, Alex Crivat wrote:
> > update _tabel_ set path=replace(path, '/path/', '/new_path/');
> > 
> > On Thu, 2004-01-22 at 12:28, Patrascu Eugeniu wrote:
> > > salut,
> > > intr-un postgres am un tabel cu capuri de de felul:
> > > 
> > >  Column |       Type        | Modifiers 
> > > --------+-------------------+-----------
> > >  id     | numeric           | 
> > >  path   | character varying | 
> > > 
> > > 
> > > iar in tabel am inregistrari de genul:
> > > 
> > > 
> > >  id |          path          
> > > ----+------------------------
> > >   1 | some/path/some_file
> > >   2 | some/path/another_file
> > > (2 rows)
> > > 
> > > 
> > > problema e ca trebuie sa modific path-ul. astfel incat de
> > > "some/path/some_file" sa am "some/new_path/some_file". stiu ca pgsql
> > > stie de regular expressions si as vrea sa stiu care este echivalentul in
> > > postgresql pentru un statement UPDATE pentru a realiza ce se face in sed
> > > ~$ echo "/some/path/some_file" | sed -e "s/path/new_path/"
> > >    /some/new_path/some_file
> > > 
> > > tia,
-- 
Alex Crivat

WWW: http://axu.rdsnet.ro
GPG: http://axu.rdsnet.ro/pgp.txt
e-Mail: [EMAIL PROTECTED]
____________________________________
Open source -> Millions of opened minds can't be wrong

-- Attached file included as plaintext by Ecartis --
-- File: signature.asc
-- Desc: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iQEVAwUAQA/O68fDzXQDxJGXAQKLsQgAiOMbtE2QLw2pT6aidNHnY3ogf+VxF4+X
i6xbW80tI7LuIh97s46VuLkK5qceqIu9NrsyVD/jjZNN2oEjdIFDq5OC4IP03lGz
bmAv9YIkLrSpEWg28NwhcsJOJ8Yl3FePH+Cig8USjhORF4R7trIje2vAKCUefn2t
e8yt+T+2eO5knrKkeYPJ6hULA4fwLvFierkjE1A6+a3M9i60DYN6GUlmAK92lrdy
xNlpl892D8O/bRdmNQ1USQSKflJJfWPIn8+Jc6x7SriTzLA5bHLK+yNJZPWRRmcd
45Jwnn0VX5aS7CWX2c3Ktkyyls++rFq8uo3+tdEEuuYPHy+jO2rF4A==
=THok
-----END PGP SIGNATURE-----



--- 
Detalii despre listele noastre de mail: http://www.lug.ro/


Raspunde prin e-mail lui