Re: How do I add/edit 'digit' property into PGAdmin4 ?

From: Karen Goh <karenworld(at)yahoo(dot)com>
To: pgsql-admin(at)lists(dot)postgresql(dot)org, "Anthony E(dot) Greene" <agreene(at)pobox(dot)com>
Subject: Re: How do I add/edit 'digit' property into PGAdmin4 ?
Date: 2019-07-20 02:23:21
Message-ID: 1648706593.2421208.1563589401174@mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Saturday, July 20, 2019, 7:41:10 AM GMT+8, Anthony E. Greene <agreene(at)pobox(dot)com> wrote:

On 19-Jul-2019/11:46 +0000, Karen Goh <karenworld(at)yahoo(dot)com> wrote:
> Hi Shreeyansh,
>
>Due to many mails in my inbox, I got to see your email only now.
>
>I'd like to seek your help in terms of how to edit the data in this column that I want to change to numeric.
>
>At one go?
>
>So, in this column that I used the wrong property type - and now it contains CountryName + the 6 digit numbers.
>
>Is there any way I can alter the data in that column at one go and remove the CountryName altogether?

If the postal code is the last six characters, then this will do what you

want:

UPDATE mytable SET mycolumn=RIGHT(mycolumn,6) WHERE mycolumn ~ '[0-9]{6}$'

TG

Hello Anthony,

It works! Please ignore my last email.
Thank you so much. Hope you have a wonderful day!
--
Anthony E. Greene <mailto:agreene(at)pobox(dot)com
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message jmz 2019-07-20 22:24:58 Fwd: Database.Schema.Table
Previous Message Karen Goh 2019-07-20 02:11:12 Re: How do I add/edit 'digit' property into PGAdmin4 ?