pg_get_constraintdef failing with cache lookup error - Mailing list pgsql-bugs

From Michael Paquier
Subject pg_get_constraintdef failing with cache lookup error
Date
Msg-id CAB7nPqRKCQkAwLNtccUTUPCdUjWSSNUKnzjdi=DpgP-etJ_OmA@mail.gmail.com
Whole thread Raw
Responses Re: pg_get_constraintdef failing with cache lookup error  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Hi all,

pg_get_constraintdef() fails rather easily:
=# select pg_get_constraintdef(1);
ERROR:  cache lookup failed for constraint 1
STATEMENT:  select pg_get_constraintdef(1);
ERROR:  XX000: cache lookup failed for constraint 1
LOCATION:  pg_get_constraintdef_worker, ruleutils.c:1305

Now by looking at pg_get_constraintdef_worker()@ruleutils.c it is
commented that this error should never happen:
        if (!HeapTupleIsValid(tup)) /* should not happen */
                elog(ERROR, "cache lookup failed for constraint %u",
constraintId);
But it happens.
Am I missing something? Shouldn't this error be changed into something
more informative?
Regards,
--
Michael

pgsql-bugs by date:

Previous
From: Michael Paquier
Date:
Subject: Re: contrib/start-scripts/linux failing on RHEL 6 with ~9.3 because of missing oom_score_adj
Next
From: Daniele Varrazzo
Date:
Subject: Re: Client deadlocks when connecting via ssl