BUG #1578: ::bit(n) behaves "differently" if applied to bit strings than integers.

From: "Celia McInnis" <celia(at)drmath(dot)ca>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #1578: ::bit(n) behaves "differently" if applied to bit strings than integers.
Date: 2005-04-04 19:28:28
Message-ID: 20050404192828.13720F0B63@svr2.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 1578
Logged by: Celia McInnis
Email address: celia(at)drmath(dot)ca
PostgreSQL version: 8.0.1
Operating system: Linux
Description: ::bit(n) behaves "differently" if applied to bit strings
than integers.
Details:

It's probably not good (at least for mathematicians!) to have the following
give different results:

select B'1110110101'::bit(6);
select B'1110110101'::integer::bit(6);

The first gives 110101 (the 6 least significant bits).
The second gives 111011 (the 6 most significant bis).

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Byron Zambrano 2005-04-04 19:41:58 BUG #1579: DO NOT CONNECT
Previous Message Roman Schayuk 2005-04-04 14:04:44 BUG #1577: round(dp) function does not round to nearest integer properly