diff --git a/ddl_deparse.c b/ddl_deparse.c index 35baacb..9e08622 100644 --- a/ddl_deparse.c +++ b/ddl_deparse.c @@ -107,7 +107,7 @@ get_altertable_subcmdinfo(PG_FUNCTION_ARGS) strtype = "ADD OIDS (and recurse)"; break; #endif -#if PG_VERSION_NUM >= 120000 +#if PG_VERSION_NUM >= 120000 && PG_VERSION_NUM < 180000 case AT_CheckNotNull: strtype = "CHECK NOT NULL"; break; @@ -138,6 +138,11 @@ get_altertable_subcmdinfo(PG_FUNCTION_ARGS) case AT_DropExpression: strtype = "DROP EXPRESSION"; break; +#if PG_VERSION_NUM >= 180000 + case AT_SetExpression: + strtype = "SET EXPRESSION"; + break; +#endif case AT_SetCompression: strtype = "SET COMPRESSION"; break; diff --git a/pgl_ddl_deploy--2.2.sql b/pgl_ddl_deploy--2.2.sql index 2bd5de7..137ed87 100644 --- a/pgl_ddl_deploy--2.2.sql +++ b/pgl_ddl_deploy--2.2.sql @@ -3048,14 +3048,17 @@ BEGIN WHEN --include_schema_regex usage: ( - (NOT $BUILD$||include_only_repset_tables||$BUILD$) AND - ( - (schema_name !~* '^(pg_catalog|pg_toast)$' + ((schema_name !~* '^(pg_catalog|pg_toast)$' AND schema_name !~* c_include_schema_regex) OR (object_type = 'schema' AND object_identity !~* '^(pg_catalog|pg_toast)$' - AND object_identity !~* c_include_schema_regex) - ) + AND object_identity !~* c_include_schema_regex)) + -- do not account in autogenerated trigger constraints, + -- i.e. for foreign keys + -- Since PG 18 they have schema_name NOT NULL, so previous + -- checks fail and such triggers are accounted + AND NOT ( + object_type = 'trigger' AND NOT original AND object_identity ~* '^"RI_ConstraintTrigger') ) --include_only_repset_tables cannot be used with DROP because --the objects no longer exist to be checked: @@ -4205,14 +4208,17 @@ BEGIN WHEN --include_schema_regex usage: ( - (NOT $BUILD$||include_only_repset_tables||$BUILD$) AND - ( - (schema_name !~* '^(pg_catalog|pg_toast)$' + ((schema_name !~* '^(pg_catalog|pg_toast)$' AND schema_name !~* c_include_schema_regex) OR (object_type = 'schema' AND object_identity !~* '^(pg_catalog|pg_toast)$' - AND object_identity !~* c_include_schema_regex) - ) + AND object_identity !~* c_include_schema_regex)) + -- do not account in autogenerated trigger constraints, + -- i.e. for foreign keys + -- Since PG 18 they have schema_name NOT NULL, so previous + -- checks fail and such triggers are accounted + AND NOT ( + object_type = 'trigger' AND NOT original AND object_identity ~* '^"RI_ConstraintTrigger') ) --include_only_repset_tables cannot be used with DROP because --the objects no longer exist to be checked: