![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
This statement is part of a longer one, which we used on 8.0 to determine the status of the locks on the database: select relation,transaction::bigint,count(*) as waiting from pg_locks where not granted group by relation,transaction; This worked fine on 8.0.x. |
#3
| |||
| |||
|
|
On Sun, Dec 10, 2006 at 03:20:50PM -0500, Tom Lane wrote: "Edwin Groothuis" <mavetju (AT) gmail (DOT) com> writes: This worked fine on 8.0.x. Really? Hmm... We used this script on 8.0.0 to 8.0.6 (which is the current database version we're running), so when I tested it on 8.0.6, I assumed it was fine on all 8.0.>6 too: |
|
Except that there isn't a custom cast... |
#4
| |||
| |||
|
|
Edwin Groothuis <edwin (AT) mavetju (DOT) org> writes: On Sun, Dec 10, 2006 at 03:20:50PM -0500, Tom Lane wrote: "Edwin Groothuis" <mavetju (AT) gmail (DOT) com> writes: This worked fine on 8.0.x. Really? Hmm... We used this script on 8.0.0 to 8.0.6 (which is the current database version we're running), so when I tested it on 8.0.6, I assumed it was fine on all 8.0.>6 too: There was no change between 8.0 and 8.0.9 on such a point, because adding or removing a cast would have required an initdb which we don't do in minor releases. Just to prove it, I checked out 8.0.6 and rebuilt it: template1=# select version(); version ---------------------------------------------------------------------------------------------------------- PostgreSQL 8.0.6 on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 4.1.1 20060525 (Red Hat 4.1.1-1) (1 row) template1=# select relation,transaction::bigint,count(*) as waiting from template1-# pg_locks where not granted group by relation,transaction; ERROR: cannot cast type xid to bigint template1=# select relation,transaction,count(*) as waiting from template1-# pg_locks where not granted group by relation,transaction; ERROR: could not identify an ordering operator for type xid HINT: Use an explicit ordering operator or modify the query. Except that there isn't a custom cast... Better look harder; there's *something* nonstandard about your 8.0 database. |
#5
| |||
| |||
|
|
Except that there isn't a custom cast... Better look harder; there's *something* nonstandard about your 8.0 database. |
#6
| |||
| |||
|
|
"Edwin Groothuis" <mavetju (AT) gmail (DOT) com> writes: This statement is part of a longer one, which we used on 8.0 to determine the status of the locks on the database: select relation,transaction::bigint,count(*) as waiting from pg_locks where not granted group by relation,transaction; This worked fine on 8.0.x. Really? regression=# select version(); version ------------------------------------------------------------------ PostgreSQL 8.0.9 on hppa2.0-hp-hpux10.20, compiled by GCC 2.95.3 (1 row) regression=# select relation,transaction::bigint,count(*) as waiting from regression-# pg_locks where not granted group by relation,transaction; ERROR: cannot cast type xid to bigint regression=# select relation,transaction,count(*) as waiting from regression-# pg_locks where not granted group by relation,transaction; ERROR: could not identify an ordering operator for type xid HINT: Use an explicit ordering operator or modify the query. which is exactly the same behavior as 8.2. I suppose you might have had a custom cast in your 8.0 database. |
|
For the purposes you're showing us, there seems no particular harm in sorting in integer order without worrying about the xid ordering, so I'd suggest you stick with the custom cast. |
![]() |
| Thread Tools | |
| Display Modes | |
| |