pg_get_constraintdef failing with cache lookup error

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: pg_get_constraintdef failing with cache lookup error
Date: 2015-04-27 07:24:38
Message-ID: CAB7nPqRKCQkAwLNtccUTUPCdUjWSSNUKnzjdi=DpgP-etJ_OmA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Daniele Varrazzo 2015-04-27 07:52:49 Re: Client deadlocks when connecting via ssl
Previous Message Michael Paquier 2015-04-26 22:31:46 Re: contrib/start-scripts/linux failing on RHEL 6 with ~9.3 because of missing oom_score_adj