Bug in CREATE TABLE .. LIKE .. INCLUDING STATISTICS? - Mailing list pgsql-bugs

From Julien Tachoires
Subject Bug in CREATE TABLE .. LIKE .. INCLUDING STATISTICS?
Date
Msg-id 20260415105718.tomuncfbmlt67oel@poseidon.home.virt
Whole thread
Responses Re: Bug in CREATE TABLE .. LIKE .. INCLUDING STATISTICS?
List pgsql-bugs
Hi,

One of our customer is experiencing an issue when executing CREATE TABLE
.. LIKE .. INCLUDING ALL; on 14, the following kind of error happens:
ERROR: cache lookup failed for attribute X of relation ZZZZZZ

It seems to come from generateClonedExtStatsStmt(): get_attname()
appears to be called with an attribute number (attnum) that does not
exist.

Please find attached 2 patches for the master branch, the first one adds
a test that triggers the problem, the 2nd one is an attempt to fix it.

Best regards,

-- 
Julien Tachoires

Attachment

pgsql-bugs by date:

Previous
From: Andrei Lepikhov
Date:
Subject: MergeJoin fails on incomplete btree opfamily definition
Next
From: PG Bug reporting form
Date:
Subject: BUG #19456: # Unit-Labeling Issue: `pg_size_pretty()` Incorrectly Labels Binary Units as Decimal Units