hex input values - Mailing list pgsql-general

From elein
Subject hex input values
Date
Msg-id MABBJCMLMNABIPABODDHAEFECFAA.elein@nextbus.com
Whole thread Raw
List pgsql-general
I cannot seem to insert hex values into an int column.
I must be doing something really stupid wrong, but I
can't see it.

insert into mytable (intcolumn) values (0xaabbcc);
    parser error at "xaabbcc"
insert into mytable (intcolumn) values ('0xaabbcc');
    pg_atoi...can't part "xaabbcc"
insert into mytable (intcolumn) values ('\0xaabbcc');
    Inserts 0 (i.e. error/null value)
insert into mytable (intcolumn) values ('\\0xaabbcc');
    pg_atoi...can't parse "\oaabbcc"

The pg_atoi() code calls strtol() which is documented
to handle hex values.

The error checking for EOS in pg_atoi() seems to be having
trouble with the leading zero.

Should I be storing these value as some other type?

thanks,

elein@nextbus.com

pgsql-general by date:

Previous
From: "imago"
Date:
Subject: Re: DROP SEQUENCE ?
Next
From: Adam Haberlach
Date:
Subject: Dangling large objects