Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hof20-0002jh-E2 for pgsql-admin@arkaria.postgresql.org; Sat, 20 Jul 2019 02:23:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hof1z-0000B6-5h for pgsql-admin@arkaria.postgresql.org; Sat, 20 Jul 2019 02:23:27 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hof1y-0000Ao-P6 for pgsql-admin@lists.postgresql.org; Sat, 20 Jul 2019 02:23:26 +0000 Received: from sonic312-22.consmr.mail.bf2.yahoo.com ([74.6.128.84]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1hof1w-0002rx-Az for pgsql-admin@lists.postgresql.org; Sat, 20 Jul 2019 02:23:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1563589402; bh=38oSQJRxN47Q3o9al5vD9cSqZDzN2zziNseNSOmK1FA=; h=Date:From:To:In-Reply-To:References:Subject:From:Subject; b=prg2eAgY7LejoqAj9fwv3TzqPQn80pKtEpWMpjqO2TWxQ/RhAAWvRjx2Fx6G6ka5RLQyN44TcCsKi7u47gnwJRgXzKCCUEkZzhMapgIa9RkeVBRVoqZqFAlFOUVs7MgTabysWh3MH33NYobhwqBggadubHcAGtupL8lHPAXQ6D+Q1bPa+Icj753+bGUK+97RRN7aROFbZeHfF/vUAZDiN/vpquwvECbrqN72hsXvEeLJijHnyAj5F3OwkpkU3NRVYrbVS2vHCh8prVuxSCVTBtsVrqb3shFnhwey2M/28Pj/g9BwJwxvdbFBP5kFcuankS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MJ_BbI sfhC9FeTM.pAc7BtizGPAw78Ud3t5kuqVJe2oUP6xNzuWnmMcnHx.qYexwfaO_S_KdzlHTGCSLTk VqtMr4Kknz7IDu0baKvqZKbOUH0RFatspqnuZiKUEuxxX2RS7L9Tzbw1mkZoRKW4NaolOFGJrAUC 0IGO_sGuk0mZ_orJiPd3WZjkxpE9ftpyijSNCf5rV3xeAq.6SEXe9CfJwqsArZJyMPKNI3pRK4iE bnmgmH.3oVVo404U4eQ-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.bf2.yahoo.com with HTTP; Sat, 20 Jul 2019 02:23:22 +0000 Date: Sat, 20 Jul 2019 02:23:21 +0000 (UTC) From: Karen Goh To: pgsql-admin@lists.postgresql.org, "Anthony E. Greene" Message-ID: <1648706593.2421208.1563589401174@mail.yahoo.com> In-Reply-To: <20190719234044.GA8328@lnxws01.localdomain> References: <503592305.1895694.1563463763702@mail.yahoo.com> <549903142.2203182.1563536801681@mail.yahoo.com> <20190719234044.GA8328@lnxws01.localdomain> Subject: Re: How do I add/edit 'digit' property into PGAdmin4 ? MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2421207_1621073420.1563589401173" Content-Length: 2410 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------=_Part_2421207_1621073420.1563589401173 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On Saturday, July 20, 2019, 7:41:10 AM GMT+8, Anthony E. Greene wrote: On 19-Jul-2019/11:46 +0000, Karen Goh 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 ------=_Part_2421207_1621073420.1563589401173 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable





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


O= n 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 numer= ic.
>
>At one go?
>
>So, in this column that I used= the wrong property type - and now it contains CountryName + the 6 digit nu= mbers.
>
>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=3DRIGHT(mycolumn,6) WHERE mycolumn ~ '[= 0-9]{6}$'

TG

Hello Anthony,

It works! Please igno= re my last email.
Thank you so much. Hope you have a wonderful day!
= --
Anthony E. Greene <mailto:agreene@pobox.com
>


=20 ------=_Part_2421207_1621073420.1563589401173--