Re: ERROR: cannot cast type text to bit varying - Mailing list pgsql-general

From Matt Miller
Subject Re: ERROR: cannot cast type text to bit varying
Date
Msg-id 1118348202.3596.37.camel@dbamm01-linux
Whole thread Raw
In response to ERROR: cannot cast type text to bit varying  (Matt Miller <mattm@epx.com>)
List pgsql-general
> It's curious to me that the following is fine:
>
> ========beginning of output=============================
> test=# select '1001'::bit varying;
>  varbit
> --------
>  1001
> (1 row)
> ========end of output============================

Okay, I guess I'm not so curious, thanks to
http://www.postgresql.org/docs/8.0/static/sql-expressions.html#SQL-
SYNTAX-TYPE-CASTS, which tells me:

"A cast applied to an unadorned string literal represents the initial
assignment of a type to a literal constant value, and so it will succeed
for any type"

But, I still have my initial problem:

> test=# select translate ('YNNY', 'YN', '10')::bit varying & translate
> ('NYYN', 'YN', '10')::bit varying;
> ERROR:  cannot cast type text to bit varying

Ideas?

pgsql-general by date:

Previous
From: Matt Miller
Date:
Subject: ERROR: cannot cast type text to bit varying
Next
From: Peter Fein
Date:
Subject: Version Control?