X-Original-To: pgsql-sql@postgresql.org Received: from matrix.gatewaynet.com (unknown [217.19.69.50]) by postgresql.org (Postfix) with ESMTP id 61C2B475E82 for ; Tue, 11 Mar 2003 03:05:32 -0500 (EST) Received: from matrix.gatewaynet.com (matrix.gatewaynet.com [217.19.69.50] (may be forged)) by matrix.gatewaynet.com (8.12.5/8.12.5) with ESMTP id h2BCEUIs023620; Tue, 11 Mar 2003 10:14:30 -0200 Received: from localhost (achill@localhost) by matrix.gatewaynet.com (8.12.5/8.12.5/Submit) with ESMTP id h2BCEUXT023616; Tue, 11 Mar 2003 10:14:30 -0200 Date: Tue, 11 Mar 2003 10:14:30 -0200 (GMT+2) From: Achilleus Mantzios To: Tom Lane Cc: pgsql-sql@postgresql.org Subject: Re: Hex Integer Input In-Reply-To: <1000.1047057194@sss.pgh.pa.us> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200303/259 X-Sequence-Number: 12299 On Fri, 7 Mar 2003, Tom Lane wrote: > Achilleus Mantzios writes: > > Hi, is there a way to enter integer data by their HEX > > representation?? > > I'm not sure that this is SQL-spec, but at least as of 7.3, you can > coerce a bitstring literal to int, so: > > z=# select x'0f'; > ?column? > ---------- > 00001111 > (1 row) > > z=# select x'0f'::int4; > int4 > ------ > 15 > (1 row) Thanx. > > Looks like it works for int8 as well. > > regards, tom lane > -- ================================================================== Achilleus Mantzios S/W Engineer IT dept Dynacom Tankers Mngmt Nikis 4, Glyfada Athens 16610 Greece tel: +30-210-8981112 fax: +30-210-8981877 email: achill@matrix.gatewaynet.com mantzios@softlab.ece.ntua.gr