Skip site navigation (1) Skip section navigation (2)

Re: hex integer input

From: Jeremy Drake <pgsql(at)jdrake(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: hex integer input
Date: 2007-03-02 07:57:28
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
On Fri, 2 Mar 2007, Tom Lane wrote:

> Jeremy Drake <pgsql(at)jdrake(dot)com> writes:
> > On several occasions I have wanted to input integers in hexadecimal rather
> > than in decimal in PostgreSQL.  I notice that there is a to_hex function,
> > but there is not (AFAIK) a way to provide an integer in hexadecimal.
> regression=# select x'abcd'::int;
>  int4
> -------
>  43981
> (1 row)

Hmm.  I actually used the bit(N) type on a project quite some time ago,
but it did not occur to me to use the bit string input syntax to input an

Well, I guess there is a way after all.  So in the immortal words of Emily
Litella, "Never mind."

In an organization, each person rises to the level of his own
		-- The Peter Principle

In response to


pgsql-hackers by date

Next:From: Vishal AroraDate: 2007-03-02 08:54:07
Subject: xlogViewer / xlogdump
Previous:From: Tom LaneDate: 2007-03-02 07:38:34
Subject: Re: hex integer input

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group