Re: Conflict Detection and Resolution - Mailing list pgsql-hackers

From vignesh C
Subject Re: Conflict Detection and Resolution
Date
Msg-id CALDaNm0MVhW2+dkbBfmfLK8wPdF_X5MwBLLs6Ag7SjtcUAK6FA@mail.gmail.com
Whole thread Raw
In response to Conflict Detection and Resolution  (shveta malik <shveta.malik@gmail.com>)
List pgsql-hackers
On Fri, 30 Aug 2024 at 11:01, Nisha Moond <nisha.moond412@gmail.com> wrote:
>
> Here is the v11 patch-set. Changes are:

1) This command crashes:
ALTER SUBSCRIPTION name RESET CONFLICT RESOLVER FOR NULL;
#0  __strcmp_avx2 () at ../sysdeps/x86_64/multiarch/strcmp-avx2.S:116
#1  0x000055c67270600a in ResetConflictResolver (subid=16404,
conflict_type=0x0) at conflict.c:744
#2  0x000055c67247e0c3 in AlterSubscription (pstate=0x55c6748ff9d0,
stmt=0x55c67497dfe0, isTopLevel=true) at subscriptioncmds.c:1664

+                       | ALTER SUBSCRIPTION name RESET CONFLICT
RESOLVER FOR conflict_type
+                               {
+                                       AlterSubscriptionStmt *n =
+                                               makeNode(AlterSubscriptionStmt);
+
+                                       n->kind =
ALTER_SUBSCRIPTION_RESET_CONFLICT_RESOLVER;
+                                       n->subname = $3;
+                                       n->conflict_type = $8;
+                                       $$ = (Node *) n;
+                               }
+               ;
+conflict_type:
+                       Sconst
                 { $$ = $1; }
+                       | NULL_P
                 { $$ = NULL; }
                ;

May be conflict_type should be changed to:
+conflict_type:
+                       Sconst
                 { $$ = $1; }
                ;
2) Conflict resolver is not shown in describe command:
postgres=# \dRs+

                                 List of subscriptions
 Name |  Owner  | Enabled | Publication | Binary | Streaming |
Two-phase commit | Disable on error | Origin | Password required | Run
as owner? | Failover | Synchronous commit |                 Conninfo
        | Skip LSN

------+---------+---------+-------------+--------+-----------+------------------+------------------+--------+-------------------+---------------+----------+--------------------+----------------------------------
--------+----------
 sub1 | vignesh | t       | {pub1}      | f      | off       | d
         | f                | any    | t                 | f
  | f        | off                | dbname=postgres host=localhost po
rt=5432 | 0/0
 sub2 | vignesh | t       | {pub1}      | f      | off       | d
         | f                | any    | t                 | f
  | f        | off                | dbname=postgres host=localhost po
rt=5432 | 0/0
(2 rows)

3) Tab completion is not handled to include Conflict resolver:
postgres=# alter subscription sub1
ADD PUBLICATION      CONNECTION           DISABLE              DROP
PUBLICATION     ENABLE               OWNER TO             REFRESH
PUBLICATION  RENAME TO            SET                  SKIP (

Regards,
Vignesh



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: altering a column's collation leaves an invalid foreign key
Next
From: Tender Wang
Date:
Subject: Re: [BUG] Fix DETACH with FK pointing to a partitioned table fails