Re: Support EXCEPT for TABLES IN SCHEMA publications

Поиск
Список
Период
Сортировка
Искать
От
Peter Smith
Тема
Re: Support EXCEPT for TABLES IN SCHEMA publications
Дата
в 10:28:53
Msg-id
CAHut+PuDB=doKUSf94cs8hOo2d5mOc+GxxPOf57xGhdE6e-Aog@mail.gmail.com
Список
Дерево обсуждения
Support EXCEPT for TABLES IN SCHEMA publications Nisha Moond <nisha.moond412@gmail.com>
Re: Support EXCEPT for TABLES IN SCHEMA publications Peter Smith <smithpb2250@gmail.com>
Re: Support EXCEPT for TABLES IN SCHEMA publications Amit Kapila <amit.kapila16@gmail.com>
Re: Support EXCEPT for TABLES IN SCHEMA publications Peter Smith <smithpb2250@gmail.com>
Re: Support EXCEPT for TABLES IN SCHEMA publications Nisha Moond <nisha.moond412@gmail.com>
Re: Support EXCEPT for TABLES IN SCHEMA publications shveta malik <shveta.malik@gmail.com>
Re: Support EXCEPT for TABLES IN SCHEMA publications Nisha Moond <nisha.moond412@gmail.com>
Re: Support EXCEPT for TABLES IN SCHEMA publications shveta malik <shveta.malik@gmail.com>
Re: Support EXCEPT for TABLES IN SCHEMA publications Peter Smith <smithpb2250@gmail.com>
Re: Support EXCEPT for TABLES IN SCHEMA publications Nisha Moond <nisha.moond412@gmail.com>
Re: Support EXCEPT for TABLES IN SCHEMA publications shveta malik <shveta.malik@gmail.com>
Re: Support EXCEPT for TABLES IN SCHEMA publications Amit Kapila <amit.kapila16@gmail.com>
Re: Support EXCEPT for TABLES IN SCHEMA publications Peter Smith <smithpb2250@gmail.com>
Re: Support EXCEPT for TABLES IN SCHEMA publications Nisha Moond <nisha.moond412@gmail.com>
Re: Support EXCEPT for TABLES IN SCHEMA publications shveta malik <shveta.malik@gmail.com>
Re: Support EXCEPT for TABLES IN SCHEMA publications shveta malik <shveta.malik@gmail.com>
Re: Support EXCEPT for TABLES IN SCHEMA publications Nisha Moond <nisha.moond412@gmail.com>
Re: Support EXCEPT for TABLES IN SCHEMA publications shveta malik <shveta.malik@gmail.com>
Re: Support EXCEPT for TABLES IN SCHEMA publications Nisha Moond <nisha.moond412@gmail.com>
Re: Support EXCEPT for TABLES IN SCHEMA publications Peter Smith <smithpb2250@gmail.com>
Re: Support EXCEPT for TABLES IN SCHEMA publications Nisha Moond <nisha.moond412@gmail.com>
Re: Support EXCEPT for TABLES IN SCHEMA publications Peter Smith <smithpb2250@gmail.com>
Re: Support EXCEPT for TABLES IN SCHEMA publications Nisha Moond <nisha.moond412@gmail.com>
Re: Support EXCEPT for TABLES IN SCHEMA publications vignesh C <vignesh21@gmail.com>
Re: Support EXCEPT for TABLES IN SCHEMA publications Nisha Moond <nisha.moond412@gmail.com>
Re: Support EXCEPT for TABLES IN SCHEMA publications vignesh C <vignesh21@gmail.com>
Re: Support EXCEPT for TABLES IN SCHEMA publications vignesh C <vignesh21@gmail.com>
Re: Support EXCEPT for TABLES IN SCHEMA publications Nisha Moond <nisha.moond412@gmail.com>
Re: Support EXCEPT for TABLES IN SCHEMA publications vignesh C <vignesh21@gmail.com>
Re: Support EXCEPT for TABLES IN SCHEMA publications Nisha Moond <nisha.moond412@gmail.com>
Hi Nisha.

Some review comments for patch v8-0004.

======
src/backend/commands/publicationcmds.c

AlterPublicationSchemaExceptTables:

1.
+ /* Collect OIDs of the desired new EXCEPT list. */
+ foreach_ptr(PublicationRelInfo, pri, rels)
+ {
+ newexceptrelids = lappend_oid(newexceptrelids,
+   RelationGetRelid(pri->relation));
+ }

Block braces {} not needed.

~~~

2.
+ if (!OidIsValid(proid))
+ continue; /* already gone */
+
+ ObjectAddressSet(obj, PublicationRelRelationId, proid);
+ performDeletion(&obj, DROP_CASCADE, 0);

SUGGESTION
if (OidIsValid(proid))
{
  ObjectAddressSet(obj, PublicationRelRelationId, proid);
  performDeletion(&obj, DROP_CASCADE, 0);
}

======
src/test/subscription/t/037_except.pl

3.
I think you had used the SQL exactly as I previously suggested, but I
made a mistake:
It should say "SELECT count(*)" instead of "SELECT a".

So it returns either 0 or 1 row.

e.g. #1
$result =
  $node_subscriber->safe_psql('postgres',
    "SELECT count(*) FROM sch1.tab_excluded WHERE a = 7");
is($result, qq(1),
    'ALTER ... SET TABLES IN SCHEMA EXCEPT: newly included table is replicated'
);
$result =
  $node_subscriber->safe_psql('postgres',
    "SELECT count(*) FROM sch1.tab_published WHERE a = 7");
is($result, qq(0),
    'ALTER ... SET TABLES IN SCHEMA EXCEPT: now-excluded table is not
replicated'
);

e.g. #2
$result =
  $node_subscriber->safe_psql('postgres',
    "SELECT count(*) FROM sch1.tab_published WHERE a = 8");
is($result, qq(1),
    'ALTER ... SET TABLES IN SCHEMA (no EXCEPT): tab_published
replicated after except list cleared'
);
$result =
  $node_subscriber->safe_psql('postgres',
    "SELECT count(*) FROM sch1.tab_excluded WHERE a = 8");
is($result, qq(1),
    'ALTER ... SET TABLES IN SCHEMA (no EXCEPT): tab_excluded
replicated after except list cleared'
);

======
Kind Regards,
Peter Smith.
Fujitsu Australia


В списке pgsql-hackers по дате отправления
От: Peter Smith
Дата:
От: Chao Li
Дата:
FAQ