dbTalk Databases Forums  

[BUGS] xid cannot be casted to a different type

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] xid cannot be casted to a different type in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Edwin Groothuis
 
Posts: n/a

Default [BUGS] xid cannot be casted to a different type - 12-10-2006 , 01:53 PM






PostgreSQL version: 8.0 / 8.1 / 8.2
Operating System: FreeBSD
Short description: xid cannot be casted to a different type
Details:

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. Now I'm preparing to move to 8.1
and/or 8.2, but that above statement now gives me:

ERROR: could not identify an ordering operator for type xid
HINT: Use an explicit ordering operator or modify the query.

According to a discussion on IRC with neilc and davidfetter:

<neilc> davidfetter, Mavvie: we need an ordering operator to do GROUP BY
<neilc> for some reason that's not clear to me atm
<neilc> perhaps because originally we only implemented grouping / aggs via sorting?
<davidfetter> neilc, makes sense, in a way
<davidfetter> yeah
<neilc> anyway, so the problem is just there aren't ordering operators for the xid type
<Mavvie> neilc: I've tried to cast the transaction field (which is the xid) to a text, bigint or something else but it keeps coming back as "cannot cast type xid to ..."
<neilc> there probably should be, like we added for tid i think in 8.2
<davidfetter> would this be an initdb-forcing thing? :f
<neilc> well, you could package the changes as sql
<davidfetter> cool
<neilc> i wouldn't personally bother backporting it tho, it's not a bug per se
<davidfetter> hrm. i'd say anything that causes you not to be able to do "expected" operations like aggregation is a bug


--
Edwin Groothuis | Personal website: http://www.mavetju.org
edwin (AT) mavetju (DOT) org | Weblog: http://weblog.barnet.com.au/edwin/

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.