| From: | Edmund Bacon <ebacon(at)onesystem(dot)com> |
|---|---|
| To: | pgsql-sql(at)postgresql(dot)org |
| Subject: | Conver bool to text |
| Date: | 2005-03-11 16:57:37 |
| Message-ID: | 4231CE01.2090902@onesystem.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-sql |
Is there a way to convert a boolean value to text and/or vice versa?
You can
select 'true'::boolean,
which *seems* to convert a text string to boolean, but
select 'true'::text::boolean
earns the message
ERROR: cannot cast type text to boolean
You can't go the other way either
SELECT true::text
ERROR: cannot cast type boolean to text
and to_char() doesn't know about booleans.
It's not that difficult to write a fuction to convert boolean to text,
but I'm wondering if there's already something that does this?
--
Edmund Bacon <ebacon(at)onesystem(dot)com>
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Marco Manfredini | 2005-03-11 22:12:28 | Re: Conver bool to text |
| Previous Message | Richard Huxton | 2005-03-11 13:05:28 | Re: [GENERAL] more execution time |