dbTalk Databases Forums  

hexdecimal constant in postgresql

comp.databases.postgresql.novice comp.databases.postgresql.novice


Discuss hexdecimal constant in postgresql in the comp.databases.postgresql.novice forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Chris
 
Posts: n/a

Default hexdecimal constant in postgresql - 07-26-2004 , 07:16 AM






hello,

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...

Bye, Chris.



---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org


Reply With Quote
  #2  
Old   
Chris
 
Posts: n/a

Default Re: hexdecimal constant in postgresql - 07-27-2004 , 02:29 AM







Quote:
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.



---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.