problem with bit(n) type

From: Sergey Karin <sergey(dot)karin(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: problem with bit(n) type
Date: 2005-10-12 08:24:41
Message-ID: b78883bf0510120124o64eb2cc7j@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi, List!

kosten=# select version();
version
---------------------------------------------------------------------------
PostgreSQL 8.0.0rc5 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.2.3
(1 row)

kosten=# create table foo(t bit(4));
CREATE TABLE

kosten=# insert into foo values(B'0011');
INSERT 985996 1

kosten=# select t from foo;
t
------
0011
(1 row)

But if I do something like this:
kosten=# select t::text from foo;
ERROR: cannot cast type bit to text

I get an error. Okay the system cannot cast bit to text...
But this is the big problem for me... Is there a way to cast bit(n) to
text or varchar?

thanks in advance.

Sergey Karin

PS. I have found that there are some functions: varbit_in() and
varbit_out(). But they works with internal type cstring. And I cannot
cast cstring to varchar or text.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Zlatko Matić 2005-10-12 09:11:08 Re: user privilages for executing pg_autovacuum?
Previous Message Zlatko Matic 2005-10-12 08:12:31 Re: user privilages for executing pg_autovacuum?