Re: create function atof?

Поиск
Список
Период
Сортировка
От Achilleus Mantzios
Тема Re: create function atof?
Дата
Msg-id Pine.LNX.4.44.0402201617130.7099-100000@matrix.gatewaynet.com
обсуждение исходный текст
Ответ на create function atof?  (mark <postgresql@novacolor.ca>)
Список pgsql-sql
O kyrios mark egrapse stis Feb 20, 2004 :

> Hello,
> 
> Is it possible to create a database function that mimics the C function atof?
> I'm guessing it should look something like this:
> 
>         create function atof(varchar) returns float
>         as '??????'
>         language ????
>         returns null on null input;

Simply use
# select '<some float>'::text::float4;
or

create function atof(varchar) returns float language sql as 'select 
$1::text::float' returns null on null input;

> 
> Thanks,
> 
> Mark
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
> 

-- 
-Achilleus



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

Предыдущее
От: mark
Дата:
Сообщение: create function atof?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: create function atof?