Re: hexdecimal constant in postgresql

From: Chris <list(at)1006(dot)org>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: hexdecimal constant in postgresql
Date: 2004-07-27 07:29:32
Message-ID: 1090913372.5322.1.camel@dell
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


> i was wondering how to specify hexadecimal constants in
> SQL in a way that postgresql understands.
>
> something like:
>
> select 0xFFFF; -- this doesn't work;
>
> I've googled for it and i've found it can be done with
> encode/decode involving a bytea type - but i'm under
> the impression there must be a more straightforward way...

I've found it myself :)

select x'FFFF'::int; -- this works

Bye, Chris.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Rafael Charnovscki 2004-07-27 13:33:45 Re: Varchar or integer primary key?
Previous Message Stephan Szabo 2004-07-27 04:49:58 Re: help with conversion functions