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.96) (envelope-from ) id 1vU4nJ-00GU1R-04 for pgsql-bugs@arkaria.postgresql.org; Fri, 12 Dec 2025 15:10:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vU4nG-008Nco-1p for pgsql-bugs@arkaria.postgresql.org; Fri, 12 Dec 2025 15:10:55 +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.96) (envelope-from ) id 1vU4nG-008Ncg-0y for pgsql-bugs@lists.postgresql.org; Fri, 12 Dec 2025 15:10:55 +0000 Received: from fout-a5-smtp.messagingengine.com ([103.168.172.148]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vU4nF-000KVm-1N for pgsql-bugs@lists.postgresql.org; Fri, 12 Dec 2025 15:10:54 +0000 Received: from phl-compute-08.internal (phl-compute-08.internal [10.202.2.48]) by mailfout.phl.internal (Postfix) with ESMTP id 107D3EC069C; Fri, 12 Dec 2025 10:10:52 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-08.internal (MEProxy); Fri, 12 Dec 2025 10:10:52 -0500 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=1765552251; x= 1765638651; bh=SEVKTSA9S9FIqHBgIzR0xuc4Olx08JsXgTwJLPJCkKg=; b=O 7ykHVcufkPwlQVTTtF4StMqkWMzXA1A3gtQjVtAcM/ppyREVQuBQSZZ3JQSl27RU wLAskG/ZAEOTuRk7tf1W40nZ8+B+zLZ4KjQY4Eqgmlxml2NP02hAObZa7Ci5SEfe 3B56KyT71LtnBFj3VHpc0j4a8pRqa6X2iz3LOSKzIgbQ5knvV2iAciL3DTyb4BSZ bicHFGbPuKQaX83QJgM2REW/SQH0PahoZ/3EiUPNRjf7v+Mhz9UZAa4pQzJyPNoZ kLo7rCam7ZcTCxt8yiW+VlqHTNE8CrV/N71JJGiIQZfk7fpcZpmbmazceHxEMAPo S4hj+f3F5WaVUX+k6pDmw== 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=1765552251; x=1765638651; bh=S EVKTSA9S9FIqHBgIzR0xuc4Olx08JsXgTwJLPJCkKg=; b=u4rr/qeTYvdiA1rya lOKRUVCk12MP/GNyF3ziMoNYCvCC6GaCnKMt6n9BnvWTZHh/GR0AwP4xe0//i+RW nglUJaSSFxTW0f+boL5wcn7qV04AwrWPT+bZ8zmBTpm8S5NuV6uCRcvpq/HTM7Iv 8sPpNzjH/9whSE+rSfHcskzGXL8AODtdvozq2zC9px/UtGiLtz36L8TyBIw1FQ1r FsdpPj/8YntnixQoeuDCxFu3gwCPJgEFT6yJZdmk6WNJOHfXRCm2ArlgJXPsB+6Z ybEry/alCgNhESb43sY7Bwxq2QdHgXQl6qkkGRGGQUwsU4ZRbTAxMz7h1mdPD/di Huxgg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvkeehtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpemllhhvrghrohcu jfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgeskhhurhhilhgvmhhurdguvgeqnecuggftrf grthhtvghrnhepteeuvdehffekvefgueehveetveekgfegtddtueefueehuddutdfhfeff hfejfeffnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomhenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvges khhurhhilhgvmhhurdguvgdpnhgspghrtghpthhtohepfedpmhhouggvpehsmhhtphhouh htpdhrtghpthhtoheprhgvshhhkhgvkhhirhhilhhlsehgmhgrihhlrdgtohhmpdhrtghp thhtohepkhgvvghshhgusehkvggvshhhihhnughsrdgtohhmpdhrtghpthhtohepphhgsh hqlhdqsghughhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 12 Dec 2025 10:10:50 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1765552248; bh=J+aLvcE1+Tjvjsy6Ui0qcHcxjidtSBdHIMdr0Y6Ll2Y=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=LGfsp/8mJ02u7SBx4UAwEqjwQtpBsfKgs8SRD01Opgc6QXs7HzVsukL4r7kZRLg9a CftHI7Pf4hmF5aDRipyMSj2dt49aGgEYCYbD+aB4+Wim8IC+I/XUXhp+K9FDQ7Rx2V aI4MfqQ1xRMlY4r4awm9rxzWXamyL4edFRmQ6SGH+U0FA0cgzdZ+/482kyXIZBBGlm zAXn6wik+vReZBp5eRlFtJhWEJT9ccogMmYKM5uwxThn+x5BNnhM46Vn1+f0t3ew8a /Uh9OCBEAJT+6APHP0WX3lvsEvdt6iDBXu4wmcUOwLsQOP1iWQVVHeBNGLQ3ARJJ1T uw+blWbP+vNrw== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id 8C77378; Fri, 12 Dec 2025 16:10:48 +0100 (CET) Date: Fri, 12 Dec 2025 16:10:48 +0100 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Kirill Reshke Cc: keeshd@keeshinds.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #19352: SQL Error messages do not include schema name along with table or data object name. Message-ID: <202512121504.x4f5zza4r47m@alvherre.pgsql> 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 Actually, these error reports do include a schema name among other things -- it's just hidden from view. For psql it's very easy to make them visible, just use \set VERBOSITY verbose Then the error message includes more detail: =# insert into sh.t2 values (1); ERROR: 23503: insert or update on table "t2" violates foreign key constraint "t2_i_fkey" DETAIL: Key (i)=(1) is not present in table "t". SCHEMA NAME: sh TABLE NAME: t2 CONSTRAINT NAME: t2_i_fkey LOCATION: ri_ReportViolation, ri_triggers.c:2770 Other clients would have their own ways to display that information. Kirill Reshke wrote: > I may be foolish but constraints are not schema-qualified, they just > have names. You're not foolish, but the schema name is attached to the table. You're correct that there can be more than one constraint with the same name in a schema, but there cannot be more than one constraint with the same name on the _table_, which is itself uniquely identified by the schema and its name. So you could argue that we could improve this by schema-qualifying the table name (not the constraint name) in this message: ERROR: 23503: insert or update on table "sh.t2" violates foreign key constraint "t2_i_fkey" -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "No me acuerdo, pero no es cierto. No es cierto, y si fuera cierto, no me acuerdo." (Augusto Pinochet a una corte de justicia)