Hi Swada-San. Here are some minor review comments for v4-0001/2 combined.
======
src/backend/catalog/pg_publication.c
is_table_publishable_in_publication:
1.
This function logic has a format like
if (cond)
{
...
return;
}
if (cond2)
{
...
return;
}
etc.
There are many return points, and most of those "if" blocks cannot
fall through (they return).
I found it slightly difficult to read the code because I kept having
to think, "OK, if we reached here, it means pubviaroot must be false,"
or "OK, if we reached this far, then puballtables must be false, and
pubviaroot must be false," etc.
Maybe a few more if/else, or a few Assert() can make it easier to
understand how we reached points deeper in this function.
~~~
pg_get_publication_tables:
2.
Several code comments appear to wrap prematurely. It looks as if
pg_indent was run when the code was different to what it is now.
~~~
pg_get_publication_tables_b:
3.
/* Get the information of the specified table in the given publication */
- return pg_get_publication_tables(fcinfo, NULL, PG_GETARG_TEXT_P(0),
PG_GETARG_OID(1));
+ return pg_get_publication_tables(fcinfo, PG_GETARG_ARRAYTYPE_P(0), relid);
Should that comment be plural now, the same as the other one?
/publication/publications/
======
src/include/catalog/pg_proc.dat
4.
proargnames => '{pubname,pubid,relid,attrs,qual}',
prosrc => 'pg_get_publication_tables_a' },
Shouldn’t the original function proargnames here also be calling the
first arg 'pubnames' instead of 'pubname'
======
src/test/regress/sql/publication.sql
5.
-- Test pg_get_publication_tables(text, oid) function
Should that comment now say text[] instead of text?
~~~
6.
Many of those tests have a "good result" test and a "no result" test
for each publication. It might be better if they were consistently in
the same order (eg, good then none, or none then good).
~~~
7.
Only 3 of the tests are passing multiple publications. Maybe those can
be separated from the others (e.g. put last, just to keep all the ones
that look alike together).
======
Kind Regards,
Peter Smith.
Fujitsu Australia