BUG #18567: ERROR: cache lookup failed for attribute 1 of relation 74580

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: jiangdian_m(at)163(dot)com
Subject: BUG #18567: ERROR: cache lookup failed for attribute 1 of relation 74580
Date: 2024-08-05 13:25:27
Message-ID: 18567-1a31eee4c9ca4325@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 18567
Logged by: Dian Jiang
Email address: jiangdian_m(at)163(dot)com
PostgreSQL version: 15.0
Operating system: centos
Description:

SQL:
Process A:
psql:
CREATE TABLE test_table (
id SERIAL PRIMARY KEY,
data TEXT
) WITH (fillfactor = 70);

CREATE INDEX test_index ON test_table (data) WITH (fillfactor = 80);
INSERT INTO test_table (data) VALUES ('sample data');

Attach gdb to process A.
In the pg_get_indexdef_worker() function, set a breakpoint at the line
context = deparse_context_for(get_relation_name(indrelid), indrelid); and
then execute the query in Process A:

SELECT pg_get_indexdef(indexrelid) FROM pg_index WHERE indrelid =
'test_table'::regclass;

Process B:
drop index test_table;
----------------------------------------------------------------
The query in process A will result in an error:

postgres:# SELECT pg_get_indexdef(indexrelid) FROM pg_index WHERE indrelid =
'test_table'::regclass;
ERROR: cache lookup failed for attribute l of relation 74580

The reason is that context =
deparse_context_for(get_relation_name(indrelid), indrelid); handles
invalidation messages, leading to cache invalidation

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2024-08-05 13:49:11 Re: BUG #18567: ERROR: cache lookup failed for attribute 1 of relation 74580
Previous Message Sandeep Thakkar 2024-08-05 11:47:28 Re: PostgreSQL 16.3 install fails on Windows with domain user if a local user exists with the same name