Re: Bit string help, please - Mailing list pgsql-sql

From tyrrill_ed@emc.com
Subject Re: Bit string help, please
Date
Msg-id 4FB0C599D8D0B14FA37B46EAD92F2153036EF2D1@CORPUSMX60C.corp.emc.com
Whole thread Raw
In response to Re: Bit string help, please  (Richard Huxton <dev@archonet.com>)
Responses Re: Bit string help, please  (Richard Huxton <dev@archonet.com>)
List pgsql-sql
Thanks for the help again, Richard.  I will look into upgrading to 8.3
as I think that will be the best solution.

Ed Tyrrill

-----Original Message-----
From: Richard Huxton [mailto:dev@archonet.com]
Sent: Thursday, March 06, 2008 10:36 AM
To: Tyrrill, Ed
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] Bit string help, please

tyrrill_ed@emc.com wrote:
> I tried this real quick at the psql command prompt, and unfortunately
it
> doesn't work:
>
> mydb=# select ('1' || repeat('0',7))::bit varying;
> ERROR:  cannot cast type text to bit varying
>
> I appreciate the try though.  Any other ideas?  I am using PostgreSQL
> 8.2.3.1.  I don't know if that matters too much.

Ah, sorry - that was an 8.3-only cast.

I think your only real option will be to build your query as a string
and use EXECUTE to get the bit-varying you want in your function.

--   Richard Huxton  Archonet Ltd



pgsql-sql by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Bit string help, please
Next
From: "Tena Sakai"
Date:
Subject: Re: Bit string help, please