pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tim Landscheidt <tim@tim-landscheidt.de>
To: pgsql-sql@postgresql.org
Subject: Re: regexp_replace and search/replace values stored in table
Date: Tue, 27 Apr 2010 13:04:23 +0000
Message-ID: <m3fx2hqc6g.fsf@passepartout.tim-landscheidt.de> (raw)
References: <201004271343.48070.leif@solumslekt.org>

Leif Biberg Kristensen <leif@solumslekt.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




view thread (7+ messages)  latest in thread

Message-ID: <m3fx2hqc6g.fsf@passepartout.tim-landscheidt.de>
Permalink:  ../m3fx2hqc6g.fsf@passepartout.tim-landscheidt.de/
Also on:    postgresql.org/message-id/m3fx2hqc6g.fsf@passepartout.tim-landscheidt.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tim@tim-landscheidt.de
  Subject: Re: regexp_replace and search/replace values stored in table
  In-Reply-To: <m3fx2hqc6g.fsf@passepartout.tim-landscheidt.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox