Re: Control PhoneNumber Via SQL

From: tango ward <tangoward15(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "raf(at)raf(dot)org" <raf(at)raf(dot)org>, "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Control PhoneNumber Via SQL
Date: 2018-05-16 03:19:57
Message-ID: CAA6wQL+N8ZHbv2P7PQvgAXpOY5MEDU=MQK=4ekx3nMaFznPp2Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ah yeah, the concatenation. I was thinking of using "+" but I can't make it
work and the documentation says not to use it for psycopg2.

Sorry what's bottom-post? I see you did that yesterday. Is there a format
for before making a bottom-post?

On Wed, May 16, 2018 at 11:04 AM, David G. Johnston <
david(dot)g(dot)johnston(at)gmail(dot)com> wrote:

> On Tuesday, May 15, 2018, tango ward <tangoward15(at)gmail(dot)com> wrote:
>
>> Sorry for bumping this email.
>>
>> I would just like to clarify regarding regexp_replace:
>>
>> WHEN mobilenumber ~'^9[0-9]' AND LENGTH(mobilenumber) = 10
>> THEN regexp_replace(mobilenumber, '', '+63')
>>
>> If the pattern is empty '', does this mean that the replacement_string
>> param will be added to the value of source? It does what I want it to do
>> but I am not sure if that's always the case if pattern param is empty.
>>
>
> If you could bottom-post like the rest of us that would be helpful.
>
> While that seems to work it is definitely obscure. You should just use
> concatenation.
>
> ’+63' || mobilenumber
>
> The pattern is a zero-length string, matched once, which first matches the
> start of the input text. Not sure what happens when the input is the empty
> string...
>
> David J.
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2018-05-16 03:55:03 Re: Control PhoneNumber Via SQL
Previous Message David G. Johnston 2018-05-16 03:04:02 Re: Control PhoneNumber Via SQL