Re: Column Filtering in Logical Replication

Поиск
Список
Период
Сортировка
От Justin Pryzby
Тема Re: Column Filtering in Logical Replication
Дата
Msg-id 20211231163227.GV24477@telsasoft.com
обсуждение исходный текст
Ответ на Re: Column Filtering in Logical Replication  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Ответы Re: Column Filtering in Logical Replication  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Список pgsql-hackers
> @@ -5963,8 +5967,20 @@ describePublications(const char *pattern)
>          {
>              /* Get the tables for the specified publication */
>              printfPQExpBuffer(&buf,
> -                              "SELECT n.nspname, c.relname\n"
> -                              "FROM pg_catalog.pg_class c,\n"
> +                              "SELECT n.nspname, c.relname, \n");
> +            if (pset.sversion >= 150000)
> +                appendPQExpBufferStr(&buf,
> +                                     "       CASE WHEN pr.prattrs IS NOT NULL THEN\n"
> +                                     "       pg_catalog.array_to_string"
> +                                     "(ARRAY(SELECT attname\n"
> +                                     "         FROM pg_catalog.generate_series(0,
pg_catalog.array_upper(pr.prattrs::int[],1)) s,\n"
 
> +                                     "              pg_catalog.pg_attribute\n"
> +                                     "        WHERE attrelid = c.oid AND attnum = prattrs[s]), ', ')\n"
> +                                     "       ELSE NULL END AS columns");
> +            else
> +                appendPQExpBufferStr(&buf, "NULL as columns");
> +            appendPQExpBuffer(&buf,
> +                              "\nFROM pg_catalog.pg_class c,\n"
>                                "     pg_catalog.pg_namespace n,\n"
>                                "     pg_catalog.pg_publication_rel pr\n"
>                                "WHERE c.relnamespace = n.oid\n"

I suppose this should use pr.prattrs::pg_catalog.int2[] ?

Did the DatumGetBool issue expose a deficiency in testing ?
I think the !am_partition path was never being hit.

-- 
Justin



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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: Extend compatibility of PostgreSQL::Test::Cluster
Следующее
От: Rémi Lapeyre
Дата:
Сообщение: Re: Add header support to text format and matching feature