pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #18567: ERROR: cache lookup failed for attribute 1 of relation 74580
2+ messages / 2 participants
[nested] [flat]

* BUG #18567: ERROR: cache lookup failed for attribute 1 of relation 74580
@ 2024-08-05 13:25 PG Bug reporting form <noreply@postgresql.org>
  2024-08-05 13:49 ` Re: BUG #18567: ERROR: cache lookup failed for attribute 1 of relation 74580 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: PG Bug reporting form @ 2024-08-05 13:25 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: jiangdian_m@163.com

The following bug has been logged on the website:

Bug reference:      18567
Logged by:          Dian Jiang
Email address:      jiangdian_m@163.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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #18567: ERROR: cache lookup failed for attribute 1 of relation 74580
  2024-08-05 13:25 BUG #18567: ERROR: cache lookup failed for attribute 1 of relation 74580 PG Bug reporting form <noreply@postgresql.org>
@ 2024-08-05 13:49 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2024-08-05 13:49 UTC (permalink / raw)
  To: jiangdian_m@163.com; +Cc: pgsql-bugs@lists.postgresql.org

PG Bug reporting form <noreply@postgresql.org> writes:
> [ pg_get_indexdef can fail on a concurrently-dropped index ]

I'm not terribly concerned about this.  In any case, the only
fix I can think of is for pg_get_indexdef to take a lock on the
index, which seems like a cure considerably worse than the
disease.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2024-08-05 13:49 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-08-05 13:25 BUG #18567: ERROR: cache lookup failed for attribute 1 of relation 74580 PG Bug reporting form <noreply@postgresql.org>
2024-08-05 13:49 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox