Re: regexp_replace and search/replace values stored in table

From: Leif Biberg Kristensen <leif(at)solumslekt(dot)org>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: regexp_replace and search/replace values stored in table
Date: 2010-04-27 13:10:26
Message-ID: 201004271510.26539.leif@solumslekt.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Tuesday 27. April 2010 15.04.23 Tim Landscheidt wrote:
> Leif Biberg Kristensen <leif(at)solumslekt(dot)org> wrote:
>
> > [...]
> > So far, so good. But when I try to do the actual expansion, I'm stumped.
>
> > pgslekt=> select regexp_replace((select source_text from sources where
> > source_id=23091), (select quote_literal(short_link) from short_links where
> > link_type = 'sk'), (select quote_literal(long_link) from short_links where
> > link_type = 'sk'), 'g');
> > regexp_replace
> >
------------------------------------------------------------------------------------------------
> > [sk=25658|67|side 66a]. Vabakken under Klyve vestre i Solum 07.07.1784:
> > [p=6947|Isach Jonsen].
> > (1 row)
>
> > What am I missing?
>
> For starters, omit the call to quote_literal ().
>
> Tim

Tim,
that was actually the first thing i tried, but I omitted it from the post:

pgslekt=> select regexp_replace((select source_text from sources where
source_id=23091), (select short_link from short_links where link_type = 'sk'),
(select long_link from short_links where link_type = 'sk'), 'g');
regexp_replace
------------------------------------------------------------------------------------------------
[sk=25658|67|side 66a]. Vabakken under Klyve vestre i Solum 07.07.1784:
[p=6947|Isach Jonsen].
(1 row)

It doesn't work either.

regards,
--
Leif Biberg Kristensen
http://solumslekt.org/

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Leif Biberg Kristensen 2010-04-27 13:32:20 Re: regexp_replace and search/replace values stored in table
Previous Message Tim Landscheidt 2010-04-27 13:04:23 Re: regexp_replace and search/replace values stored in table