Re: bitfromint4() in v7.2.3 to bit() in v8.1? - Mailing list pgsql-bugs

From Tom Lane
Subject Re: bitfromint4() in v7.2.3 to bit() in v8.1?
Date
Msg-id 1051.1240322456@sss.pgh.pa.us
Whole thread Raw
In response to bitfromint4() in v7.2.3 to bit() in v8.1?  (Björn Þór Jónsson <bangsi@bthj.is>)
List pgsql-bugs
Björn Þór Jónsson <bangsi@bthj.is> writes:
> In version 7.2.3 this works fine:

> select substring(bitfromint4(cast (-2^31 + 22 as int4)), 1, 32);

> and now I'm porting the legacy code, that this line is part of, to version
> 8.1 but am having no luck updating it - have tried something like:

Use a cast, eg

regression=# select cast (-2^31 + 22 as int4)::bit(32);              bit
----------------------------------10000000000000000000000000010110
(1 row)

        regards, tom lane


pgsql-bugs by date:

Previous
From: "Arjen Nienhuis"
Date:
Subject: BUG #4769: xmlconcat produces invalid xml values -> data corruption
Next
From: Bruce Momjian
Date:
Subject: Re: BUG #4768: FATAL:could not reattach to shared memory:487