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.98.2) (envelope-from ) id 1x7DYG-00000000C8I-18k3 for pgsql-hackers@arkaria.postgresql.org; Thu, 17 Sep 2026 14:57:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1x7DYF-00000004uQO-1ssV for pgsql-hackers@arkaria.postgresql.org; Thu, 17 Sep 2026 14:57:27 +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.98.2) (envelope-from ) id 1x7DYF-00000004uQE-06cn for pgsql-hackers@lists.postgresql.org; Thu, 17 Sep 2026 14:57:27 +0000 Received: from fout-a6-smtp.messagingengine.com ([103.168.172.149]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1x7DYD-000000009nZ-0xr1 for pgsql-hackers@lists.postgresql.org; Thu, 17 Sep 2026 14:57:26 +0000 Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailfout.phl.internal (Postfix) with ESMTP id 9F81DEC00D1; Thu, 17 Sep 2026 10:57:24 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-03.internal (MEProxy); Thu, 17 Sep 2026 10:57:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kurilemu.de; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to; s=fm3; t=1789657044; x= 1789743444; bh=jTBtlP7VaUxcVADDHR2gaaneqAHsze58oSEPVmWsRFo=; b=t TX4WjwcqF7aDXHnOYPPrXKCXhnJprrxAG29TGLXLElmsJeeBtBGqVJuacNjZRhFc O4ZY685thEl3EA76QNONK66cAcZysXJKlcYrkelG0W0H6Cjbd25JaGK9ul+WE3Qb qWRTl3IUc4ITW4qbbMEDICd1ev6kxnCdlGhLU0jcVkN9lm3XqiOk1SY4PepeHhn1 VusjupNlkLTxQFyKquqWX0pW01S8uv6TronfYf6D2A92pSqhb7UDF/i4wLBTxM/w obOsQ2BOP1zN4qC4vwOxQUA8WttQzb+GAd15+KmNp1EUeehPmOwOtDp9vZXY0RAD 4/OOf/gyghqlXznxO904A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1789657044; x=1789743444; bh=j TBtlP7VaUxcVADDHR2gaaneqAHsze58oSEPVmWsRFo=; b=quir29MAOo+vB1pP4 lR6z9JteKW8e3ARx9wVya0z6SwYELVWCXRD0uc/SZovzVA2rngmBSB/fQRsbFSzw 8AfEQhUz+2u3ECsh/YgDTZlnPaQkCxwoppwM7FK08qnrDzveGRfUmf1Shjp1mgTR VpqFxG8ajBKwzwAB4HUOiFSspUhGpX9hsNmZVYMBCypPfG2+jAE4aCipLk2kADfg qOTJudAxve1eAY8K4IpiUUEtXpAgLKeBu0sD4C4+Gv57+UQKmb+Xf5g9TJjy0+/L Tv80t3WUeBZjXtjHXKCTmOF1O4Asc4UMNaaWMUQXciuZvELl3eQ07Y7haHRKVcZR /QK6A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTEpeqnIBezra3n5OxsrYEjXAcg5MnY+gcYiN2IynA6m/VTw+hJOmUiTblYLnee60t W0V/ByDk5N06u/gWUbWvNfLE06f7kUh9E5CldgdE1b0m+lC7yEEL+sQpJlnBUfVyabQ3ga UQMbWM3M/OGwJpMSzWSz44HS6rUUySLebo2ceh4UsBkCzSMZfRjhahCmmrow7ffMpSVtFT epuEsZAFSrf6q0bILRXk2iAXoTy7ZPdgm63ztl+wpmoGv4C8Toz378aamEuMHgcADlHu0W iLi/7t7DGac6P2dulD+i8lnrRduuPJdfMKKU0u2oFdQ80/QqS4ypMrASYBIic56QQy9gH+ bwl4NP7DBef5+WzbaBjeNyklHReMQ+xG1UhhJ876pvcgwP6NinBA2HlO69wp2JTaDBwLee jDWx8yat/kJVfXUTAYjDPqQp+q5fn+FWsmTbyoz3grj67zNV/4PJvESAbP+ZpzPez5JHUJ 6QLDvPf3wcr2uGFDzlgth4gaG6MkUGDn006CBI1F+jqk8VsUMYrHmZorWNah9IXJSdnVWK fgBBnrreio/6eQp+6V00IsLyR/skgV3cX7WX7rAVxLPPdsWjQylUuVcvPvFjLWdRLMUSXO neweLqSRklpwQ/3TNEHDotvsM2bYUB4RIkIJ1dyPCEswv7L46dg2byVyg7MQ X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 17 Sep 2026 10:57:24 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1789657042; bh=CCKbHP8J4ApYXrsSGXnxF7sk0NlLrNh4GpC7lzeSASg=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=ZXClinoRfJIm1kjR+g+graoEpd7rrkf1JYegZZm6FkGi6QUfzwhUCprJO3YcECNtl XXzJ82GF7U7wd3uuvI25hiv12+nv2+uOPPTO/QOT0n/9qsvtwMLSktAvml89gkoIIs zBNScjP90nszE36govfuVF5MUdiihnN1xPlz6zqP3YyFA67mTfPuX3neF5sGnnSwgy lofV5wzwgeWLnTrprF2zHJ8Ee5lznCAYBJjfmdq8UK/MHrUvfOVhPsyGInLUZAmvT0 Ft40RQNahcEhlud+EyWrPm1GOQ5MX1ZTlrckwh3U1PhELIt6eZsq/cu7pMRWqfL0lO WdRJRf4jL4JTA== Received: by ida.kurilemu.internal (Postfix, from userid 1000) id 25CBCB0008E; Thu, 17 Sep 2026 16:57:22 +0200 (CEST) Date: Thu, 17 Sep 2026 16:57:22 +0200 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Manuel Reyes Bravo Cc: PostgreSQL Hackers , Amit Kapila , Peter Smith , shveta malik Subject: Re: pg_get_object_address reports a published relation as non-existent Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2026-Sep-17, Manuel Reyes Bravo wrote: > The case > -------- > > CREATE TABLE t1(a int); > CREATE PUBLICATION pub FOR ALL TABLES; > > SELECT schemaname, tablename FROM pg_publication_tables > WHERE pubname = 'pub'; > schemaname | tablename > ------------+----------- > public | t1 > > SELECT pg_get_object_address('publication relation','{public,t1}','{pub}'); > ERROR: publication relation "t1" in publication "pub" does not exist I'm not sure this is a valid complaint. pg_publication_tables is a user-friendly view, so there's no reason for pg_get_object_address() to react to values obtained from there, I think. The docs for pg_get_object_address say: Returns a row containing enough information to uniquely identify the database object specified by a type code and object name and argument arrays. The returned values are the ones that would be used in system catalogs such as pg_depend; they can be passed to other system functions such as pg_describe_object or pg_identify_object. classid is the OID of the system catalog containing the object; objid is the OID of the object itself, and objsubid is the sub-object ID, or zero if none. This function is the inverse of pg_identify_object_as_address. Undefined objects are identified with NULL values. Now if you look in pg_depend after creating the publication FOR ALL TABLES, you can see this: alvherre=# select objid, (pg_identify_object(classid, objid, objsubid)).*, deptype, (pg_identify_object(refclassid, refobjid, refobjsubid)).* from pg_depend where objid > 16000; objid | type | schema | name | identity | deptype | type | schema | name | identity -------+-------+--------+------+-------------+---------+--------+--------+--------+----------- 16400 | type | public | _t1 | public.t1[] | i | type | public | t1 | public.t1 16401 | type | public | t1 | public.t1 | i | table | public | t1 | public.t1 16399 | table | public | t1 | public.t1 | n | schema | | public | public No representation is visible for the table being in the publication. If you drop that publication and create it for that table specifically, instead you get alvherre=# drop publication pub ; DROP PUBLICATION alvherre=# create publication pub for table t1; CREATE PUBLICATION alvherre=# select objid, (pg_identify_object(classid, objid, objsubid)).*, deptype, (pg_identify_object(refclassid, refobjid, refobjsubid)).* from pg_depend where objid > 16000; objid | type | schema | name | identity | deptype | type | schema | name | identity -------+----------------------+--------+------+------------------------------+---------+-------------+--------+--------+----------- 16400 | type | public | _t1 | public.t1[] | i | type | public | t1 | public.t1 16401 | type | public | t1 | public.t1 | i | table | public | t1 | public.t1 16399 | table | public | t1 | public.t1 | n | schema | | public | public 16407 | publication relation | | | public.t1 in publication pub | a | publication | | pub | pub 16407 | publication relation | | | public.t1 in publication pub | a | table | public | t1 | public.t1 Have a look at how src/test/regress/sql/object_address.sql sets up for roundtripping these things ... Does that make sense? -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "La verdad no siempre es bonita, pero el hambre de ella sí"