Re: row filtering for logical replication

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: row filtering for logical replication
Дата
Msg-id 202112261609.qp3j4dz2ha2b@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: row filtering for logical replication  ("Euler Taveira" <euler@eulerto.com>)
Ответы Re: row filtering for logical replication  ("Euler Taveira" <euler@eulerto.com>)
Список pgsql-hackers
On 2021-Dec-26, Euler Taveira wrote:

> On Sat, Dec 25, 2021, at 1:20 AM, Amit Kapila wrote:
> > On Fri, Dec 24, 2021 at 11:04 AM Peter Smith <smithpb2250@gmail.com> wrote:
> > >
> > > So, IMO the PG docs wording for this part should be relaxed a bit.
> > >
> > > e.g.
> > > BEFORE:
> > > +   A nullable column in the <literal>WHERE</literal> clause could cause the
> > > +   expression to evaluate to false; avoid using columns without not-null
> > > +   constraints in the <literal>WHERE</literal> clause.
> > > AFTER:
> > > +   A nullable column in the <literal>WHERE</literal> clause could cause the
> > > +   expression to evaluate to false. To avoid unexpected results, any possible
> > > +   null values should be accounted for.

Is this actually correct?  I think a null value would cause the
expression to evaluate to null, not false; the issue is that the filter
considers a null value as not matching (right?).  Maybe it's better to
spell that out explicitly; both these wordings seem distracting.

You have this elsewhere:

+      If the optional <literal>WHERE</literal> clause is specified, only rows
+      that satisfy the <replaceable class="parameter">expression</replaceable> 
+      will be published. Note that parentheses are required around the 
+      expression. It has no effect on <literal>TRUNCATE</literal> commands.

Maybe this whole thing is clearer if you just say "If the optional WHERE
clause is specified, rows for which the expression returns false or null
will not be published."  With that it should be fairly clear what
happens if you have NULL values in the columns used in the expression,
and you can just delete that phrase you're discussing.

-- 
Álvaro Herrera              Valdivia, Chile  —  https://www.EnterpriseDB.com/



В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Euler Taveira"
Дата:
Сообщение: Re: row filtering for logical replication
Следующее
От: "Joel Jacobson"
Дата:
Сообщение: Re: Foreign key joins revisited