Re: text(bool), text(numeric)

Поиск
Список
Период
Сортировка
От Vicktor
Тема Re: text(bool), text(numeric)
Дата
Msg-id 20011128203005.478a7ade.vic@adv.ru
обсуждение исходный текст
Ответ на Re: text(bool), text(numeric)  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список pgsql-bugs
On Wed, 28 Nov 2001 08:35:00 -0800 (PST)
Stephan Szabo <sszabo@megazone23.bigpanda.com> wrote:

 Ok, thank !

Vicktor

> On Wed, 28 Nov 2001, Vicktor wrote:
>
> > Hello All,
> >
> >  Why not exists functions for convert any type to text?
> >  I can't find text(bool), text(numeric) ...
> >  May be it posiible in 7.2?
>
> Don't think so.  You need those functions and noone has written
> them officially.
>
> The former is easy, something like:
>
> create function text(bool) returns text as 'select case when $1 then
> ''true'' else ''false'' end;' language 'sql';
>
> should suffice.
>
>
> I'm not entirely sure this is entirely safe for the latter, but you can
> try :)
>
>  create function numericout(numeric) returns int as 'numeric_out' language
> 'internal';
>  create function text(numeric) returns text as 'select
> textin(numericout($1));' language 'sql';
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: text(bool), text(numeric)
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: text(bool), text(numeric)