Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uV66J-00DO9O-Nd for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Jun 2025 10:14:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uV66H-000u2L-Q1 for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Jun 2025 10:14:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uV66H-000u2D-Fi for pgsql-hackers@lists.postgresql.org; Fri, 27 Jun 2025 10:14:30 +0000 Received: from mail-yw1-x1131.google.com ([2607:f8b0:4864:20::1131]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uV66F-004Nv8-2O for pgsql-hackers@lists.postgresql.org; Fri, 27 Jun 2025 10:14:29 +0000 Received: by mail-yw1-x1131.google.com with SMTP id 00721157ae682-71173646662so21568587b3.2 for ; Fri, 27 Jun 2025 03:14:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751019266; x=1751624066; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=rICAqLWMEfdKzS1r/7Yqz9498MXaoh7STdZZbGbB5jM=; b=YXR2tvEzYAt9M8LOoqYiL1s6q6aB6m1j1WcHcwPiONAt8KrWELla26yN2mHKxPunSx 8pjst7MNjal+kTMyP3bf2x7oS2tpH8VPlG2vmkUCr6Rpf9BQ5icW1v/Lztv7soDjjq71 GnaeaFnvlbXFKTw01pIkr4E7AEFlulLCxMjITTS9W3HscXIcxVFzpLscweknmj5EOEF5 dO1fvFWJeco01lZbtgRPfzXyIncHliXDStSL1xbazxoj7KPpMgu/+uNtQq6xw4IN+A5X 3A/+1tc99vkxikU6ixLkH+49XLcnZ4qRdIlm1UL/BnSCVWuYDzfw49d9UuY8cmua82Oh Jtuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751019266; x=1751624066; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rICAqLWMEfdKzS1r/7Yqz9498MXaoh7STdZZbGbB5jM=; b=uQtl1c8ZFoNxKLt3SmFXthjvmBvCmC4uqBEfu3CcXKqC3vPbcoTZmXGR73ACYlwfoh 9DRyYVO1OYgrn3ESQSnkO8mH6IS82Di8FPxtZN4V3j0BU5w8zbrT56w8SIl6edeOdVeX H3lUKm7UULa+7EkFVhr7/CFKY5tbWce5bPp3obz5+3MyfW4zg10/KfCSKO3jI//nd5xm NOsM4t/8+yu76P8hQYFrsLhK6QP/FvOMusKSnIR5YJPznkZE4s14j45Vewk9gYboFj4r 5vSLo4oz8c2G5yydGTAVeaOGlqE1+Grr/1axSaT8l/vwm8T3TBqs6h+GwBoo/GUr4YXa hROQ== X-Forwarded-Encrypted: i=1; AJvYcCVKLztf3Tjy4k8Ik+dUg9DslZZuaDWxGLx5MMHxvlq2w+fCvnMmqT31dhW2Ax+0eID8XvjmPfcB88KeCp6A@lists.postgresql.org X-Gm-Message-State: AOJu0YxhfnOU3SRfedycqutLbn0R2DahVoBT+wfDm7SCWUPQmh0RupgJ +Rtm/08SqjgBxCCdH4eXpOdyguSL40xDSBsTOlAO9SlGRMoqcId6mwK8V1v51PsR8nm3wLpvjTR TuQTkWHjSobyXhAehN4eDyzwXiXSMUiM= X-Gm-Gg: ASbGncvWu7xtB2IvR4MLFaIH9SFTDji2nmM7HbA/5Ah7lc75XQhHY3aCmPCWBdUi8VG n9GANv4/BkAD9bD7mii8G0yHu6bX/yXm23jB2Wg7gJWIQOK6sxuqwtI8GRjPcD5UjVX8Tl0V9zc s2my7sMcHWKbUwRCsaQZblUEuxfjfeI9nY+r5iUC2zM6O27h1U9yPxsqaR X-Google-Smtp-Source: AGHT+IF7iVcCn6fM+LcGIV7tU8qaBTPW29dcuEnKz84zlf9JWiMs1Gg39xSBq5hR78wQqhoXQ0SvTJY2vLY9Kew8Ibc= X-Received: by 2002:a05:690c:708c:b0:70e:2ba2:659d with SMTP id 00721157ae682-7151719608emr38146307b3.23.1751019266045; Fri, 27 Jun 2025 03:14:26 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Shlok Kyal Date: Fri, 27 Jun 2025 15:44:14 +0530 X-Gm-Features: Ac12FXzI3p3CXZsG-fVV2jv9AHyYWpsrdZc2G80qV4Pct4WirNRGsh0bDOIacIc Message-ID: Subject: Re: Skipping schema changes in publication To: shveta malik Cc: Peter Smith , Amit Kapila , "Zhijie Hou (Fujitsu)" , vignesh C , YeXiu <1518981153@qq.com>, Ian Lawrence Barwick , Bharath Rupireddy , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, 26 Jun 2025 at 15:27, shveta malik wrote: > > On Tue, Jun 24, 2025 at 9:48=E2=80=AFAM Shlok Kyal wrote: > > > > I have included the changes for > > it in v14-0003 patch. > > > Thanks for the patches. I have reviewed patch001 alone, please find > few comments: > > 1) > + > + The RESET clause will reset the publication to the > + default state which includes resetting the publication parameters, se= tting > + ALL TABLES flag to false and > + dropping all relations and schemas that are associated with the > + publication. > > > It is misleading, as far as I have understood, we do not drop the > tables or schemas associated with the pub; we just remove those from > the publication's object list. See previous doc: > "The ADD and DROP clauses will add and remove one or more > tables/schemas from the publication" > > Perhaps we want to say the same thing when we speak about the 'drop' > aspect of RESET. I have updated the document. > 2) > AlterPublicationReset(): > > + if (!OidIsValid(prid)) > + ereport(ERROR, > + (errcode(ERRCODE_UNDEFINED_OBJECT), > + errmsg("relation \"%s\" is not part of the publication", > + get_rel_name(relid)))); > > Can you please help me understand which scenario will give this error? > > Another question is do we really need this error? IIUC, we generally > give errors if a user has explicitly called out a name of an object > and that object is not found. Example: > > postgres=3D# alter publication pubnew drop table t1,tab2; > ERROR: relation "t1" is not part of the publication > > While in a few other cases, we pass missing_okay as true and do not > give errors. Please see other callers of performDeletion in > publicationcmds.c itself. There we have usage of missing_okay=3Dtrue. I > have not researched myself, but please analyze the cases where > missing_okay is passed as true to figure out if those match our RESET > case. Try to reproduce if possible and then take a call. I thought about the above point and I also think this check is not required. Also, the function was calling PublicationDropSchemas with missing_ok as false. I have changed it to be true. > 3) > +ALTER PUBLICATION testpub_reset ADD ALL TABLES IN SCHEMA public; > +ERROR: syntax error at or near "ALL" > +LINE 1: ALTER PUBLICATION testpub_reset ADD ALL TABLES IN SCHEMA pub... > > There is a problem in syntax, I think the intention of testcase was to > run this query successfully. I have fixed it. Thanks Shveta for reviewing the patch. I have addressed the comments and posted an updated version v15 in [1]. [1]: https://www.postgresql.org/message-id/CANhcyEU%2BaPu6iAH2cTA0cDtn3pd6c= _njBONCt3FubYZoEEnm8Q%40mail.gmail.com Thanks and Regards, Shlok Kyal