Re: hexadecimal values

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: hexadecimal values
Дата
Msg-id 200205030030.RAA19070@smtp.ucsd.edu
обсуждение исходный текст
Ответ на hexadecimal values  (Thierry Besancon <Thierry.Besancon@paris4.sorbonne.fr>)
Список pgsql-general
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

В списке pgsql-general по дате отправления:

Предыдущее
От: Lev Lvovsky
Дата:
Сообщение: order of adding date & interval values?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Fwd: Postfix Relay Hub SMTP server: errors from postgresql.org[64.49.215.8]