On 2/13/26 00:08, Wim Rouquart wrote:
Internal

Ok, to do a small recap because indeed this thread has been extended for a 
while now.

- The issue with the specific index was noted on a production database (after a 
datarefresh that partly failed because of the missing index).

- To reproduce and experiment with the issue, a pg_basebackup was taken from 
that prod instance and restored to a test instance. Every single test step is 
executed on this test instance, the prod database is no longer involved, 
pg_basebackup is no longer involved, everything is pg_dump based from here on 
onwards.

- So this means the test pg_dumps where done with the index in a 'non-fuctional 
state'. As expected, the create statement of the index does NOT show up in the 
generated .sql scripts (neither 'loose' nor in the create statement of the 
table).

1) It won't be included with the CREATE TABLE statement per:-

https://www.postgresql.org/docs/current/app-pgdump.html

"--section=sectionname

Only dump the named section. The section name can be pre-data, data, or post-data. This option can be specified more than once to select multiple sections. The default is to dump all sections.

The data section contains actual table data, large-object contents, sequence values, and statistics for tables, materialized views, and foreign tables. Post-data items include definitions of indexes, triggers, rules, statistics for indexes, and constraints other than validated check and not-null constraints. Pre-data items include all other data definition items.
"
2) The issue seems to be not the dump, but the non-functional state of the index on the source database.

Is there any indication of why that is happening?

Also what error do you get on the source database that tells you the PK is not working?





I hope this clears out any confusion.

-----Original Message-----
Adrian Klaver
[email protected]


Reply via email to