Volatile EquivalenceClass has no sortref
I'm running: PostgreSQL 9.0.3 (Last Debian stable)
This query:
SELECT * FROM sis.thread_categories stc, sis.threads st WHERE st.id_thread_categories=stc.id
=> throws:
ERROR: volatile EquivalenceClass has no sortref State SQL: XX000
Same problem occured when I've tried it using JOIN. Does anybody 开发者_如何学Pythonknow what am I doing wrong?
I think you might have a corrupted database, that is not supposed to happen. From backend/optimizer/path/pathkeys.c
in the PostgreSQL source:
List *
convert_subquery_pathkeys(PlannerInfo *root, RelOptInfo *rel,
List *subquery_pathkeys)
{
/*...*/
if (sub_eclass->ec_sortref == 0) /* can't happen */
elog(ERROR, "volatile EquivalenceClass has no sortref");
That error message shows up in two other places in the source but the triggering condition, ec_sortref == 0
, is the same and the same "can't happen" comments appears in all three places.
So either your database is corrupt or you have found a bug in PostgreSQL.
精彩评论