Few comments for 002: 1) @@ -210,9 +269,16 @@ ObjectsInPublicationToOids(List *pubobjspec_list, ParseState *pstate, break; case PUBLICATIONOBJ_TABLES_IN_SCHEMA: schemaid = get_namespace_oid(pubobj->name, false); + schema_name = pubobj->name; + schema_repeated = list_member_oid(*schemas, schemaid);
/* Filter out duplicates if user specifies "sch1, sch1" */ *schemas = list_append_unique_oid(*schemas, schemaid); + + ProcessSchemaExceptTables(schemaid, schema_name, + pubobj->except_tables, pstate, + schema_repeated, &schemas_with_except, + Should we extract schema_name inside ProcessSchemaExceptTables, as we are passing schemaid to it. Generally one such arguement should suffice. 2) We can also avoid passing 'schema_repeated' to function ProcessSchemaExceptTables(). Instead we can pass input/output arg 'schemas' similar to 'schemas_with_except'. Let it extract 'repeated' from schemas internally and also populate it internally with unique schema-oid. 3) ProcessSchemaExceptTables: can we avoid repeated dereferences of eobj->pubtable->relation. We can work with: RangeVar *relation = eobj->pubtable->relation; 4) + + if (except_tables != NIL) + *schemas_with_except = lappend_oid(*schemas_with_except, schemaid); We can return early here: if (except_tables == NIL) return; *schemas_with_except = lappend_oid(*schemas_with_except, schemaid); thanks Shveta
