Re: Postgres Wishlist - Mailing list pgsql-novice

From Michael Glaesemann
Subject Re: Postgres Wishlist
Date
Msg-id C6A31827-F349-459E-A5F9-5CD682C002C8@seespotcode.net
Whole thread Raw
In response to Re: Postgres Wishlist  ("Donald Kerr" <donald.kerr@dkerr.co.uk>)
Responses Re: Postgres Wishlist  ("Donald Kerr" <donald.kerr@dkerr.co.uk>)
List pgsql-novice
On Nov 13, 2010, at 3:32 , Donald Kerr wrote:

> Thank you, Tom.
>
> I have tried what you suggest but it does not seem to work:
> 'x'||substring(col,3,2)::text::bit(8)::int returns - "9" is not a valid
> binary digit.

Try with parens:

postgres=# select ('x' || 99::text)::bit(8)::int;
 int4
------
  153
(1 row)

postgres=# select version();
                                                                 version
                  

------------------------------------------------------------------------------------------------------------------------------------------
 PostgreSQL 9.0.1 on x86_64-apple-darwin10.4.0, compiled by GCC i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc.
build5664), 64-bit 
(1 row)


Michael Glaesemann
grzm seespotcode net




pgsql-novice by date:

Previous
From: "Donald Kerr"
Date:
Subject: Re: Postgres Wishlist
Next
From: "Donald Kerr"
Date:
Subject: Re: Postgres Wishlist