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 1qM1RS-001Dt2-KQ for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Jul 2023 07:17:46 +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 1qM1RQ-001UDm-SW for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Jul 2023 07:17:44 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qM1RQ-001UDe-J5 for pgsql-hackers@lists.postgresql.org; Wed, 19 Jul 2023 07:17:44 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qM1RN-000Gl6-G6 for pgsql-hackers@lists.postgresql.org; Wed, 19 Jul 2023 07:17:42 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 916FE5C0097; Wed, 19 Jul 2023 03:17:40 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 19 Jul 2023 03:17:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1689751060; x=1689837460; bh=5x JMZsYGwEWeKJ1qY9nNhoZfSSeevZz6c1MfS5BeKfc=; b=PXGZA9MwRCrYuB/GDs L2Fy3gIEIbea/+hnordCMAN1oMElo7QAOYk5hSaJgl9JAyPM7cgqJXIcI1NUV75W TG/XkuvR7sJtny+A8jqjE2tTSnOqRf/TLAVKdX4nj36F5hMpaN+L6K/l31ra7YeP 8/6UeWrO1l0AmEeJ5HLTmmC1pmS/IC1wuj/sOe/f1NEq0VtjJezIgosoUYMtRVF9 jTbasv/M4rZu3hMSxd8pOtRS8T7tCgC+dMqGq6jvVQtir6EjI9MfgxlNhSdtXxeG iMwDWYEsSpV2o9k7UEoX5VT+n35lNS/XeajG8sVq/3D3VNgp8o+4hT6lulveR7Rq DTHQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1689751060; x=1689837460; bh=5xJMZsYGwEWeK J1qY9nNhoZfSSeevZz6c1MfS5BeKfc=; b=MZ3TCRLZwCI53oCAi3lakz7TMpjag Cz+a93KLNyUc3QSJwfMkZ8D9coW3EOrcfBeZVbgJMxa6EFn2zshjHf4itoMtIyax rH7xrBheItg5GlkLsOgbE1dVWbOxMq9SP3+M4eYNE2PNJTBg4WA128vMh7PN16/M SR5W0uR6G78aJaF1d4uXKw5R5mxptfl+/SpuiMUtV/W7c5b0onZh4ZiTLqAyDtBC N6DYmKiSl6kGb260WJTni1ccWOLtkq08O+NIZFCvzMx8GomQwsY1LUob5FPMNWgu n0fhz6egogsmdQnhTinjqDr9WzJF2YTayOtUp6/xeh2n5qD1L/Xdrib8Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrgeehgdduudeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtdorredt tddunecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnheptdfhjeevtdeivdegveeludek udefjeehffejleejvefhgfdugffhgfeuheekhfetnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiih ii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 19 Jul 2023 03:17:37 -0400 (EDT) Date: Wed, 19 Jul 2023 16:17:32 +0900 From: Michael Paquier To: Peter Smith Cc: Julien Rouhaud , "Hayato Kuroda (Fujitsu)" , PostgreSQL Hackers , Amit Kapila Subject: Re: pg_upgrade and logical replication Message-ID: References: <20230309083456.xpjcsuycyn7d2yvr@jrouhaud> <20230327084955.m624nwfaf7mbzo6j@jrouhaud> <20230407022802.jqmdhgjhrnj5lpcl@jrouhaud> <20230424072224.qd3awkfrjcanw2pa@jrouhaud> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="sj06OEQZLTX4lC1e" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --sj06OEQZLTX4lC1e Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 10, 2023 at 05:59:24PM +1000, Peter Smith wrote: > 1. ALTER SUBSCRIPTION name ADD TABLE (relid =3D XYZ, state =3D 'x' [, lsn= =3D 'X/Y']) >=20 > I was a bit confused by this relation 'state' mentioned in multiple > places. IIUC the pg_upgrade logic is going to reject anything with a > non-READY (not 'r') state anyhow, so what is the point of having all > the extra grammar/parse_subscription_options etc to handle setting the > state when only possible value must be 'r'? We are just talking about the handling of an extra DefElem in an extensible grammar pattern, so adding the state field does not represent much maintenance work. I'm OK with the addition of this field in the data set dumped, FWIW, on the ground that it can be useful for debugging purposes when looking at --binary-upgrade dumps, and because we aim at copying catalog contents from one cluster to another. Anyway, I am not convinced that we have any need for a parse-able grammar at all, because anything that's presented on this thread is aimed at being used only for the internal purpose of an upgrade in a --binary-upgrade dump with a direct catalog copy in mind, and having a grammar would encourage abuses of it outside of this context. I think that we should aim for simpler than what's proposed by the patch, actually, with either a single SQL function =E0-la-binary_upgrade() that adds the contents of a relation. Or we can be crazier and just create INSERT queries for pg_subscription_rel to provide an exact copy of the catalog contents. A SQL function would be more consistent with other objects types that use similar tricks, see binary_upgrade_create_empty_extension() that does something similar for some pg_extension records. So, this function would require in input 4 arguments: - The subscription name or OID. - The relation OID. - Its LSN. - Its sync state. > 2. state V relstate >=20 > I still feel code readbility suffers a bit by calling some fields/vars > a generic 'state' instead of the more descriptive 'relstate'. Maybe > it's just me. >=20 > Previously commented same (see [1]#3, #4, #5) Agreed to be more careful with the naming here. -- Michael --sj06OEQZLTX4lC1e Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmS3jgwACgkQnvQgOdby QH3pIQ/+KuSy8EuR62Nuvk1d/3iL9tYmDqtOVjNGvfy7HfSi3aEYtrwYnfboXX2y gFAt4GXffVMpR8+qcbUBfJhsEdnUKBrmploFq6Hb58b7dxudLMvoy93bvDYsh05Z TkVYQDkDqgd4cI2/pecDebtNubOIL/C5beu5kQB4wEhfDFq3yDuKIZeaMBSI1l0c VuXejNYhX6Lv4lTnquM6NWHjqawFFgBv8OOx1MlRp/7/vDEeu7XWLXjOUcG3QUnc WomE1VVVhspeyYMVx4DjiB7gXV23vQDu7MkmhbQPrJqrI4i+KgBvGszdlE3bf0FM o8gMJfAL+g8D7JFWFHlP/hx4qBHSU75QNL58VUZoXp3TdD+fSElnBJjATn6U+gkI lRARFFlTiS1B121PKhge/KrQPaaq4IzLdC8kABKbH9HYY7ByI9BHZbqRZRd2+CKB Ek/Ks8GNdnShhqrKtIz6+3TajGtaKzwxjLjZ9+DjCnDY7IvDVSvd3OgJyKSAjLWR srqNL5xiJLSAfyPRZ9KBm3G1DO3l9qpjwgSE+tXp3dQS4vQvN1Ik227dvroOLolj CQEJLLQYocYxeGyKYw3UYLWB3F9H8QyN8m83Snf60LhJN6wyyICg0g0SMYAeGP2z WJv2f0ZbSZW9FFgTH+FPG+8y7SsUXGT/dKvBrqmUJSodUQpJLKs= =Caqm -----END PGP SIGNATURE----- --sj06OEQZLTX4lC1e--