citus icon indicating copy to clipboard operation
citus copied to clipboard

citus_finish_pg_upgrade() on PG 14 if there is a foreign table

Open onderkalaci opened this issue 3 years ago • 1 comments

psql:/tmp/citus-catalog-v9-save20220719-6328-nhwg4h:6: ERROR:  "foreign_table" is a foreign table
DETAIL:  Foreign tables cannot have TRUNCATE triggers.
CONTEXT:  SQL statement "create trigger truncate_trigger_45903 after truncate on foreign_tables_schema_mx.foreign_table execute procedure pg_catalog.citus_truncate_trigger()"
PL/pgSQL function citus_finish_pg_upgrade() line 91 at EXECUTE

Probably need to skip foreign tables here: https://github.com/citusdata/citus/blob/5b3537cdff35363461d30b745efaf60790cbe7a7/src/backend/distributed/sql/udfs/citus_finish_pg_upgrade/latest.sql#L106-L116

onderkalaci avatar Jul 20 '22 12:07 onderkalaci

I think we can do: SELECT logicalrelid FROM pg_catalog.pg_dist_partition JOIN pg_class ON (logicalrelid = oid) WHERE relkind <> 'f'

marcocitus avatar Jul 21 '22 10:07 marcocitus

Closed by: #6100 #6103 #6106 #6171 #6176

agedemenli avatar Aug 18 '22 09:08 agedemenli