Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlq8B-0003av-S3 for pgsql-sql@arkaria.postgresql.org; Sun, 27 Aug 2017 05:29:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dlq89-0002YA-QP for pgsql-sql@arkaria.postgresql.org; Sun, 27 Aug 2017 05:29:05 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dlq88-0002Xy-8H for pgsql-sql@postgresql.org; Sun, 27 Aug 2017 05:29:04 +0000 Received: from n3.nabble.com ([162.255.23.22]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlq84-00018e-OV for pgsql-sql@postgresql.org; Sun, 27 Aug 2017 05:29:02 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 6B878814490E for ; Sat, 26 Aug 2017 22:28:59 -0700 (MST) Date: Sat, 26 Aug 2017 22:28:59 -0700 (MST) From: anand086 To: pgsql-sql@postgresql.org Message-ID: <1503811739437-5980300.post@n3.nabble.com> Subject: Hex to Number conversion MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org Hi, We have a Oracle system were the hex characters are converted to number using TO_NUMBER function, like below. sql> select to_number('cd08cfba70ede0a2','xxxxxxxxxxxxxxxx') from dual; TO_NUMBER('CD08CFBA70EDE0A2','XXXXXXXXXXXXXXXX') -------------------------------------------------- 14774286977254416546 How can I achieve the same in postgres. # select to_number('cd08cfba70ede0a2','xxxxxxxxxxxxxxxx'); ERROR: invalid input syntax for type numeric: " " Time: 142.581 ms Regards, Anand -- View this message in context: http://www.postgresql-archive.org/Hex-to-Number-conversion-tp5980300.html Sent from the PostgreSQL - sql mailing list archive at Nabble.com. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql