Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id EAE9D2E2D9E for ; Thu, 6 Mar 2008 14:36:03 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 10575-10 for ; Thu, 6 Mar 2008 14:35:54 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from ptb-relay02.plus.net (ptb-relay02.plus.net [212.159.14.213]) by postgresql.org (Postfix) with ESMTP id 8BE672E02D1 for ; Thu, 6 Mar 2008 14:35:54 -0400 (AST) Received: from [84.51.143.99] (helo=server3.office.archonet.com) by ptb-relay02.plus.net with esmtp (Exim) id 1JXKwZ-0005Qt-HU; Thu, 06 Mar 2008 18:35:52 +0000 Received: from [192.168.1.36] (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTP id 51FE9274060; Thu, 6 Mar 2008 18:35:51 +0000 (GMT) Message-ID: <47D03987.9000307@archonet.com> Date: Thu, 06 Mar 2008 18:35:51 +0000 From: Richard Huxton User-Agent: Thunderbird 2.0.0.12 (X11/20080213) MIME-Version: 1.0 To: tyrrill_ed@emc.com CC: pgsql-sql@postgresql.org Subject: Re: Bit string help, please References: <4FB0C599D8D0B14FA37B46EAD92F2153036EEC5E@CORPUSMX60C.corp.emc.com> <47CFA7B7.9080902@archonet.com> <4FB0C599D8D0B14FA37B46EAD92F2153036EF2A2@CORPUSMX60C.corp.emc.com> In-Reply-To: <4FB0C599D8D0B14FA37B46EAD92F2153036EF2A2@CORPUSMX60C.corp.emc.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Plusnet-Relay: d4345059ce51cd91ee52dd74284c17e9 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/28 X-Sequence-Number: 30356 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