Re: Generating fields in views with search/replace?

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: "Asfand Qazi (Sanger Institute)" <aq2(dot)sanger(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Generating fields in views with search/replace?
Date: 2011-05-05 14:30:08
Message-ID: BANLkTik-XtHQqCy82y7-r2vfiZKKSs0PyA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, May 5, 2011 at 9:09 AM, Asfand Qazi (Sanger Institute)
<aq2(dot)sanger(at)gmail(dot)com> wrote:
> Hi,
>
> Say I have a table with fields 'template' and 'original_letter', and
> 'new_selected_letter'.  'template' could be 'abcdefg0abcdefg',
> original_letter could be 'A' and new_selected_letter could be 'B'.
>
> I want a view where I see 2 fields: 'original' as 'abcdefgAabcdefg'
> and 'new_selected' as 'abcdefgBabcdefg', where the view has replaced
> the '0' with original_letter or new_selected_letter respectively.
>
> Sorry for the silly example, but is there a way for me to do this in
> Postgresql?  I'm using Postgresql 9

The mechanics of making a view do something like that is trivial, but
your example doesn't make clear why the character '0' is special and
is the one translated?

merlin

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Boreham 2011-05-05 14:35:39 Re: SSDD reliability
Previous Message Asfand Qazi (Sanger Institute) 2011-05-05 14:09:56 Generating fields in views with search/replace?