Hi,

REPACK (CONCURRENTLY) fails with a confusing "no identity index" error
when a materialized view is specified. Please find attached a patch
that reports a proper error, similar to the other cases in
check_concurrent_repack_requirements(), and adds a note to the docs. I
think this needs to be backpatched to PG19.

Thoughts?

[1]
postgres=# CREATE MATERIALIZED VIEW m AS SELECT 1 AS a;
SELECT 1
postgres=# REPACK (CONCURRENTLY) m;
ERROR:  cannot execute REPACK (CONCURRENTLY) on relation "m"
HINT:  Relation "m" has no identity index.

-- 
Bharath Rupireddy
Amazon Web Services: https://aws.amazon.com

Attachment: v1-0001-Fix-error-message-for-concurrent-repack-on-materi.patch
Description: Binary data

Reply via email to