Oh, that makes more sense. I don't think that there is an internal postgres
stored procedure for doing that, but I can't imagine it would be that hard to
write one.
I suppose that someone could add the ability to parse hex values in the text
to int converter. Is that what you'd like to see? that way you could do:
select '0x10'::int;
or:
select '10'::int;
and they would return 16 and 10 respectively.
It also should be quite easy to do the conversion in your application before
sending it to the database. Look at the C function strtol().
Regards,
Jeff
On Thursday 02 May 2002 03:06 pm, Thierry Besancon wrote:
> >> What do you mean you won't know in advance? If not, how do you tell the
> >> difference between 10 hexadecimal (which is 16) and 10 decimal (which is
> >> 10) ?
>
> I mean the user can input 0x10 or 010 or 10 and I want the C way of dealing
> with these numbers.
>
> Thierry