Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jC5Vm-00043g-OC for pgsql-general@arkaria.postgresql.org; Wed, 11 Mar 2020 17:51:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jC5Vk-00012n-Pk for pgsql-general@arkaria.postgresql.org; Wed, 11 Mar 2020 17:51:16 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jC5Vi-00010S-Rm for pgsql-general@lists.postgresql.org; Wed, 11 Mar 2020 17:51:16 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jC5VW-0005lK-4X for pgsql-general@postgresql.org; Wed, 11 Mar 2020 17:51:10 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 324CF44E; Wed, 11 Mar 2020 13:50:58 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 11 Mar 2020 13:50:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=y OOIFqjgH/mxCBOOenwgGaDvxHeM/EpfI9ZYPhwye3Y=; b=pAMBGTStYLpVRXrub mp67+iTFYcSkZu4g0LgVzQBQxGou5nGuhgFEB5qLVKDg42+HI+NDAMfX7Q/eW6Sj HNr2JYSyt6BgrXlRIyAJiDykZsBHAi9tW/gIfzVr+V0zhtKyZ4TgKQvoCHedOPDG OB6y7drFtNZgTG5Ys0UjkDjfmD16GCqk0G5w1x131nbyR7MXmYkpFq+QNlLNBBCU 3SAhb3h5AvWwgsLhRDxbSyC2cb8RDgJAzuQAhDcocsLxBtms4Mq4BdjT41cV6dQr ZXw2IFZ40a989q3blganysvzr61dT9CL3oBQWaVGJFi4nADl59U4RtcU+lkuwhSs vsqEg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=yOOIFqjgH/mxCBOOenwgGaDvxHeM/EpfI9ZYPhwye 3Y=; b=PXIhj0CY/yMdlHYh+O0jT1oc6JRkyRuJDS+GsDdubxxV614sc1Querm08 LZOJPLLZwynKC9JHb/ORgu+fL0SGZiY2HLlgEJnfLP6MWoeQ1uOBy8NaSZdHcM9l qz/NppGbrUk+HFEwY9QdCxBszeRD98h0C4M4AOHGzRlU1GcKBx+oa7p5gnLXUh8U PbAFhOTZmNt4d4MqwOb35b0lbwy+pydmZJ+l6/ahdwzI3O+pyLFQQdNBUdKchpeq QNqbwq9Hl8p4o7XGp1ZO7Q5wwoS9Heu1L+zvAq/cnrht/uxwU0ZnvvD0cIHV+o53 jDnWTsRaJ7iUcYzPc7h21P2ATQT3Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedruddvvddguddtiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepuffvfhfhkffffgggjggtgfesth ekredttdefjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdr khhlrghvvghrsegrkhhlrghvvghrrdgtohhmqeenucffohhmrghinhepphhoshhtghhrvg hsqhhlqdgrrhgthhhivhgvrdhorhhgnecukfhppeejgedrleegrdejfedrvddvvdenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnh drkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Received: from ranger.suse (unknown [74.94.73.222]) by mail.messagingengine.com (Postfix) with ESMTPA id 30A843280066; Wed, 11 Mar 2020 13:50:57 -0400 (EDT) Subject: Re: How to discover what table is To: PegoraroF10 , pgsql-general@postgresql.org References: <1583688412554-0.post@n3.nabble.com> <43b445af-270e-813e-76b5-01578f635b56@gmail.com> <1583694648424-0.post@n3.nabble.com> <1583842571230-0.post@n3.nabble.com> <22a2bdfa-72f0-c687-f8d3-62685c3debbd@aklaver.com> <1583854924493-0.post@n3.nabble.com> <42329e25-1acf-fded-d129-243c1d2e791f@aklaver.com> <1583914924920-0.post@n3.nabble.com> From: Adrian Klaver Message-ID: Date: Wed, 11 Mar 2020 10:50:56 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <1583914924920-0.post@n3.nabble.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 3/11/20 1:22 AM, PegoraroF10 wrote: > Well, for now it´s solved but I´ll explain what happens to solve it better on > future. > Suppose on Master you have a database with hundreds of schemas with same > structure, so table Customer happens 500 times on that DB. That database > being replicated with publication/subscription for all tables model, just > that. Now to have new schemas added to this database you go to replica, > create them with structure only, go to master and create them with data, go > back to replica and refresh publication. But then imagine that one of those > schemas you´ve created on replica with data. This is where problem occurs > and message is just PK of Table Customer is duplicated but is not easy to > find which table because I´ll have that table and that key on 90% of my > schemas. If, on error message we just have which schema belongs that table > would be great. Some digging found that the ERROR uses get_rel_name for the relation name and that led to: ~/src/backend/utils/cache/lsyscache.c /* * get_rel_name * Returns the name of a given relation. * * Returns a palloc'd copy of the string, or NULL if no such relation. * * NOTE: since relation name is not unique, be wary of code that uses this * for anything except preparing error messages. */ Going any further is going to need someone with more knowledge of the above to chime in. > > > > -- > Sent from: https://www.postgresql-archive.org/PostgreSQL-general-f1843780.html > > -- Adrian Klaver adrian.klaver@aklaver.com