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 1j9A6I-0000b5-VE for pgsql-hackers@arkaria.postgresql.org; Tue, 03 Mar 2020 16:08:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j9A6H-0008Hd-Ng for pgsql-hackers@arkaria.postgresql.org; Tue, 03 Mar 2020 16:08:53 +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 1j9A6H-0008HW-Bj for pgsql-hackers@lists.postgresql.org; Tue, 03 Mar 2020 16:08:53 +0000 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j9A6E-000325-HK for pgsql-hackers@lists.postgresql.org; Tue, 03 Mar 2020 16:08:53 +0000 Received: by mail-qt1-x843.google.com with SMTP id d22so1857698qtn.0 for ; Tue, 03 Mar 2020 08:08:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=/JT4+sYvCbQEajH0dORfp65vXNBqncZgdRp3QFvOmek=; b=cFjmTNhl42vxLG29IzuGaZuAp5y0oh9ahOZHag26PLGgF7FYz+p5Guurm4D9/SRV/R QyDGbytjCrmtHF5uZONiu/4bLv6yI28hP07o/T8g3nYSk9TaSUcG8dPUT2InQG+2UXzv ZNZQUDl5i6pWGFbh0ubbAjppQlhuV+roOo2eWTEv5m7mz87DZEq1FinGNfWXm3BhLUza 9DaUZ5Gkm9iQcKWYajnEXFfox+o/KaLbVLXIB5ZBfo7fHFqbhe0O5Ck3/IKMCz9loIeV Ve5sW13Y/ahK5dBBviLR+q9Vq9k7A/WTXZQ4WCs3BoMvIid+/w6y0NzcFGb/Xyf20s2g OGKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=/JT4+sYvCbQEajH0dORfp65vXNBqncZgdRp3QFvOmek=; b=tMbufsjf8y7zGMwaskjWw9nSjfahcdQIdJ1yKuK2VUV6TbCOYqkpnhAyESFadA8Wg+ 32Ho9M+n7Dw5+hB2J/dBT843IO5WylBHsFJqfcYyXdi7B8ZwRlAuZ8EUyiNPnyXTIKCG TCPUFyY1bf6QMQlmutwexzFfBS6u4C7hKP+9SVHpw/sH1l9QNW0usmP1rIe0HvUJmikE nYHEtaXpd8rZGk5GK5dYDhTA6M33QvXLCXnqMIqtHmnMmDGrRqoEs3KtvIqxmw7Eimq1 hwgQNguBtAtD0Hv8cU+eN9sJlV7VnAxnPOyEz5utO04IxTMYf3IEpPtx6e6Yfazm/w/h 9pvQ== X-Gm-Message-State: ANhLgQ1PrJfkEy499v8P5IrXpKYg4NqcxbPWf1NafGiLcAMckjfoql7/ l3S+/YAvGuCKnoVmNz9k2yfFIw== X-Google-Smtp-Source: ADFU+vvjuOqOV4E9nUF9cjCkEiq1P/3n2ng67bOUIOquaa7XPNNp+Vnrf8Fjgf9kwlxJy5C0BCakOA== X-Received: by 2002:aed:35d4:: with SMTP id d20mr5164971qte.181.1583251729001; Tue, 03 Mar 2020 08:08:49 -0800 (PST) Received: from nimloth.alvh.no-ip.org ([201.186.208.119]) by smtp.gmail.com with ESMTPSA id z4sm5418728qkz.85.2020.03.03.08.08.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Mar 2020 08:08:48 -0800 (PST) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id B7E5E30068E; Tue, 3 Mar 2020 13:08:46 -0300 (-03) Date: Tue, 3 Mar 2020 13:08:46 -0300 From: Alvaro Herrera To: Chris Bandy Cc: Amit Langote , Amit Kapila , PostgreSQL Hackers Subject: Re: [PATCH] Add schema and table names to partition error Message-ID: <20200303160846.GA2728@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <0acc36c9-1aef-1057-0c29-de473c850605@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > +\set VERBOSITY verbose > +-- no partitions > +CREATE TABLE pterr1 (x int, y int, PRIMARY KEY (x, y)) PARTITION BY RANGE (y); > +INSERT INTO pterr1 VALUES (10, 10); > +ERROR: 23514: no partition of relation "pterr1" found for row > +DETAIL: Partition key of the failing row contains (y) = (10). > +SCHEMA NAME: public > +TABLE NAME: pterr1 > +LOCATION: ExecFindPartition, execPartition.c:349 This won't work well, because people would be forced to update the .out file whenever the execPartition.c file changed to add or remove lines before the one with the error call. Maybe if you want to verify the schema/table names, use a plpgsql function to extract them, using GET STACKED DIAGNOSTICS TABLE_NAME = ... in an exception block? I'm not sure that this *needs* to be tested, though. Don't we already verify that errtable() works, elsewhere? I don't suppose you mean to test that every single ereport() call that includes errtable() contains a TABLE NAME item. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services