pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Karen Goh <karenworld@yahoo.com>
To: pgsql-admin@lists.postgresql.org, "Anthony E. Greene" <agreene@pobox.com>
Subject: Re: How do I add/edit 'digit' property into PGAdmin4 ?
Date: Sat, 20 Jul 2019 02:23:21 +0000 (UTC)
Message-ID: <1648706593.2421208.1563589401174@mail.yahoo.com> (raw)
In-Reply-To: <20190719234044.GA8328@lnxws01.localdomain>
References: <503592305.1895694.1563463763702@mail.yahoo.com>
	<CAGDYbUOzp1BQQO+Mi+cHKReG1FcOzWnnFFQZ9LjmJBL4f8kDnA@mail.gmail.com>
	<549903142.2203182.1563536801681@mail.yahoo.com>
	<20190719234044.GA8328@lnxws01.localdomain>

 




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


On 19-Jul-2019/11:46 +0000, Karen Goh <karenworld@yahoo.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@pobox.com
>



  

view thread (7+ messages)

Message-ID: <1648706593.2421208.1563589401174@mail.yahoo.com>
Permalink:  ../1648706593.2421208.1563589401174@mail.yahoo.com/
Also on:    postgresql.org/message-id/1648706593.2421208.1563589401174@mail.yahoo.com

 · 

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-admin@postgresql.org
  Cc: karenworld@yahoo.com, agreene@pobox.com
  Subject: Re: How do I add/edit 'digit' property into PGAdmin4 ?
  In-Reply-To: <1648706593.2421208.1563589401174@mail.yahoo.com>

* 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