RE: Added schema level support for publication.

Поиск
Список
Период
Сортировка
От tanghy.fnst@fujitsu.com
Тема RE: Added schema level support for publication.
Дата
Msg-id OS0PR01MB6113CDF7C66403145DB0BFBCFBA29@OS0PR01MB6113.jpnprd01.prod.outlook.com
обсуждение исходный текст
Ответ на Re: Added schema level support for publication.  (Masahiko Sawada <sawada.mshk@gmail.com>)
Ответы Re: Added schema level support for publication.  (vignesh C <vignesh21@gmail.com>)
Список pgsql-hackers
On Wednesday, September 22, 2021 11:22 AM Masahiko Sawada <sawada.mshk@gmail.com> wrote:
> 
> ---
> +                       if (!IsA(node, String))
> +                               ereport(ERROR,
> +                                               errcode(ERRCODE_SYNTAX_ERROR),
> +                                               errmsg("invalid schema
> name at or near"),
> +
> parser_errposition(pstate, pubobj->location));
> 
> The error message should mention where the invalid schema name is at
> or near. Also, In the following example, the error position in the
> error message seems not to be where the invalid schemaname s.s is:
> 
> postgres(1:47707)=# create publication p for all tables in schema s.s;
> ERROR:  invalid schema name at or near
> LINE 1: create publication p for all tables in schema s.s;
>                                  ^
> 

I noticed this, too. And I think it could be fixed by the following change, thoughts?

--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -9681,7 +9681,7 @@ PublicationObjSpec:       TABLE pubobj_expr
                                        {
                                                $$ = $5;
                                                $$->pubobjtype = PUBLICATIONOBJ_REL_IN_SCHEMA;
-                                               $$->location = @1;
+                                               $$->location = @5;
                                        }
                        | pubobj_expr
                                        {


Besides, about this change in tab-complete.c:

+    else if (Matches("ALTER", "PUBLICATION", MatchAny, "ADD|DROP|SET", "SCHEMA"))
+        COMPLETE_WITH_QUERY(Query_for_list_of_schemas
+                            " UNION SELECT 'CURRENT_SCHEMA'");

It should be "ALL TABLES IN SCHEMA" not "SCHEMA" at the first line, right?

Regards
Tang

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

Предыдущее
От: Dilip Kumar
Дата:
Сообщение: Re: row filtering for logical replication
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: Added schema level support for publication.