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

BUG #2821: xid cannot be casted to a different type

From: "Edwin Groothuis" <mavetju(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2821: xid cannot be casted to a different type
Date: 2006-12-10 01:13:32
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      2821
Logged by:          Edwin Groothuis
Email address:      mavetju(at)gmail(dot)com
PostgreSQL version: 8.0 / 8.1. / 8.
Operating system:   FreeBSD
Description:        xid cannot be casted to a different type

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
    <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


pgsql-bugs by date

Next:From: Devrim GUNDUZDate: 2006-12-10 16:41:41
Subject: Re: BUG #2813: missing RPM build dependency: tcl-devel
Previous:From: Edwin GroothuisDate: 2006-12-09 23:44:09
Subject: xid cannot be casted to a different type

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