Skip site navigation (1) Skip section navigation (2)

Re: bitfromint4() in v7.2.3 to bit() in v8.1?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Björn Þór Jónsson <bangsi(at)bthj(dot)is>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: bitfromint4() in v7.2.3 to bit() in v8.1?
Date: 2009-04-21 14:00:56
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
=?ISO-8859-1?B?Qmr2cm4g3vNyIErzbnNzb24=?= <bangsi(at)bthj(dot)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);
(1 row)

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Bruce MomjianDate: 2009-04-21 14:13:57
Subject: Re: BUG #4768: FATAL:could not reattach to shared memory:487
Previous:From: Arjen NienhuisDate: 2009-04-21 12:11:00
Subject: BUG #4769: xmlconcat produces invalid xml values -> data corruption

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group