From: | Peter Eisentraut <peter_e(at)gmx(dot)net> |
---|---|
To: | Vicktor <vic(at)adv(dot)ru> |
Cc: | <pgsql-bugs(at)postgresql(dot)org> |
Subject: | Re: text(bool), text(numeric) |
Date: | 2001-11-28 20:50:09 |
Message-ID: | Pine.LNX.4.30.0111281429110.636-100000@peter.localdomain |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
Vicktor writes:
> Why not exists functions for convert any type to text?
> I can't find text(bool), text(numeric) ...
Just because *some* mapping between data types exists it doesn't mean it's
the sound, well-defined, be-all-end-all. For instance, one might think
that TRUE => 't' and FALSE => 'f' is a reasonable bool=>text conversion,
but the first person you'll run into will claim that 1 and 0 is better,
and the second person will say that the answer should be locale-dependent.
So instead of bothering with this you get to make your own choice with
CASE WHEN value THEN 'value if true' ELSE 'value if false' END
The issues are similar with numeric=>text, but the to_char() family of
functions should be able to solve all your problems in this area.
--
Peter Eisentraut peter_e(at)gmx(dot)net
From | Date | Subject | |
---|---|---|---|
Next Message | pgsql-bugs | 2001-11-29 12:06:19 | Bug #524: Bad quoting of backslash in text arrays |
Previous Message | Vicktor | 2001-11-28 17:30:05 | Re: text(bool), text(numeric) |