Re: Any functions to convert bit(5) to text?

From: Együd Csaba <csegyud(at)vnet(dot)hu>
To: 'Michael Fuhr' <mike(at)fuhr(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Any functions to convert bit(5) to text?
Date: 2005-02-10 07:55:12
Message-ID: 0IBO00AZ7RC1J2@mail.vnet.hu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)fuhr(dot)org]
Sent: Thursday, February 10, 2005 8:32 AM
To: Együd Csaba
Cc: pgsql-general(at)postgresql(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Surabhi Ahuja 2005-02-10 12:25:08 postgres server failure during some database opearion
Previous Message Michael Fuhr 2005-02-10 07:31:57 Re: Any functions to convert bit(5) to text?