http://www.postgresql.org/docs/current/static/
functions-matching.html#FUNCTIONS-POSIX-REGEXP

Asta nu ajuta?

On Thursday 22 January 2004 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,

-- 
  Claudiu Cismaru
  GPG Key: http://maya.cnixs.com/~claudiu/claudiu.gpg

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


Raspunde prin e-mail lui