Re: Any functions to convert bit(5) to text? - Mailing list pgsql-general

From Együd Csaba
Subject Re: Any functions to convert bit(5) to text?
Date
Msg-id 0IBO00AZ7RC1J2@mail.vnet.hu
Whole thread Raw
In response to Re: Any functions to convert bit(5) to text?  (Michael Fuhr <mike@fuhr.org>)
List pgsql-general
Hi Michael,
at the first glance it seems to be perfect. In addition it works even for
arrays. Wow! :)

Thank you very much,
-- Csaba

-----Original Message-----
From: Michael Fuhr [mailto:mike@fuhr.org]
Sent: Thursday, February 10, 2005 8:32 AM
To: Együd Csaba
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Any functions to convert bit(5) to text?

On Thu, Feb 10, 2005 at 12:16:53AM -0700, Michael Fuhr wrote:
>
> SELECT textin(bit_out(b)) FROM foo;

Is it generally true that you can convert between types using the above
method, assuming compatible syntax?  That is, using the source type's output
function to get a cstring that you pass to the target type's input function?
Are there any potential problems with doing this?  Is that how the PL/pgSQL
RETURN trick works?  It seems a handy way to cast one type to another when
no built-in cast or function exists.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.8.6 - Release Date: 2005.02.07.



pgsql-general by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: Any functions to convert bit(5) to text?
Next
From: "Surabhi Ahuja "
Date:
Subject: postgres server failure during some database opearion