X-Original-To: pgsql-sql@postgresql.org Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id C6622476586 for ; Fri, 7 Mar 2003 12:13:11 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.8/8.12.8) with ESMTP id h27HDEx6001001; Fri, 7 Mar 2003 12:13:14 -0500 (EST) To: Achilleus Mantzios Cc: pgsql-sql@postgresql.org Subject: Re: Hex Integer Input In-reply-to: References: Comments: In-reply-to Achilleus Mantzios message dated "Fri, 07 Mar 2003 18:14:39 -0200" Date: Fri, 07 Mar 2003 12:13:14 -0500 Message-ID: <1000.1047057194@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200303/203 X-Sequence-Number: 12243 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) Looks like it works for int8 as well. regards, tom lane