Re: \d t: ERROR: XX000: cache lookup failed for relation - Mailing list pgsql-hackers

From Justin Pryzby
Subject Re: \d t: ERROR: XX000: cache lookup failed for relation
Date
Msg-id 20180604173409.GD5164@telsasoft.com
Whole thread Raw
In response to Re: \d t: ERROR: XX000: cache lookup failed for relation  (Teodor Sigaev <teodor@sigaev.ru>)
Responses Re: \d t: ERROR: XX000: cache lookup failed for relation
List pgsql-hackers
On Mon, Jun 04, 2018 at 08:01:41PM +0300, Teodor Sigaev wrote:
> >Also note that my "INSERT" was run in a separate loop, concurrent with the
> >VACUUM and ALTER, but yours is running consecutively.
> 
> both loops run in backgound. I tried to run two scripts -  and got a lot of
> deadlocks but not a probem reproduction.

Ah, I think this is the missing, essential component:
CREATE INDEX ON t(right(i::text,1)) WHERE i::text LIKE '%1';

I can reproduce it running just this loop:

time while :; do for a in `seq 999`; do psql postgres --port 5678 -c "ALTER TABLE t ALTER i TYPE int USING i::int";
done;done
 

Justin


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Remove mention in docs that foreign keys on partitioned tablesare not supported
Next
From: Tom Lane
Date:
Subject: Re: Remove mention in docs that foreign keys on partitioned tables are not supported