Search Postgresql Archives

Re: ERROR: cannot cast type text to bit varying

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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?

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux