Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jOUZO-0002tk-VB for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Apr 2020 23:02:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jOUZN-0006fn-2I for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Apr 2020 23:02:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jOUZM-0006fX-Kv for pgsql-hackers@lists.postgresql.org; Tue, 14 Apr 2020 23:02:16 +0000 Received: from mail-qv1-xf44.google.com ([2607:f8b0:4864:20::f44]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jOUZJ-0002vO-EV for pgsql-hackers@postgresql.org; Tue, 14 Apr 2020 23:02:15 +0000 Received: by mail-qv1-xf44.google.com with SMTP id k9so803316qvw.7 for ; Tue, 14 Apr 2020 16:02:12 -0700 (PDT) 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=LfGQ0+Z+4W3a/SKc+ThNV/AObq+zi5zByI3QVxpwqco=; b=i9Xs7d0AJzLVpyu2kjKKJgtyAtazhEzKCFTQn0NVhkV2W8ZXWetkwD3oSYM4C0zUUU qqk9MIMxqC9plJPEdNS8kNuPRAMjH5Wtr67OMd8PfUGq6D48nO+QB8sdr3rp9Hc8Mu6L xaXldHkyebZLICCxQtRQ7DV8svtjPbAv2Mn3bZYYgyq0VJUpiaWZ3lHfT6dUY7BlGq0J OiGCBMLcXoVNrBu/KSG/GYj0pEUFFivhFHBiF6ecWBUEb1gNieNA8I4GFbA3itkMQ+hk v8g7oXfYoK5A4LM3i7ImTtb4OiYR1J1WatL20qO2eKh1dqjQ4k3aTTz6Z4XflJpZoh63 g0PA== 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=LfGQ0+Z+4W3a/SKc+ThNV/AObq+zi5zByI3QVxpwqco=; b=pkB5h8XoE8C4k+CcJOdhO/4UXIFEuHrxRG4gpeGWtSDqzmhOxNxHh6w+LK+omq22Y5 8aHALxhbYTuRW+YwIwHjJJVhPC7PkYNdr+6xpewyDiaJrgL5uFJ8DdLw7rcu6o7NRBO5 sZXOQrv2mjJREb9HcerJ97oTQW18F87U8Mu2UDRbp4y3oLEIdRccF00vXoiBVnmcGwNk AlVzkSpT4dyC7LfnCgiGr2FwagJv1GCuJiZ3YYum8qi0NTZ1g9m2is4/i28W3DXshuxM orDATGaqBISONpUf8/HQhWuowGDaL4+6NMZwLk3+e76oI+cwxOhaZ5NLA9Syg4yfG52y TDdg== X-Gm-Message-State: AGi0PubokdazYATzETD1ib0lJZtacLVIFwDSSaHoF4xjb2Uvpw/PNE6H 8hFALx9THCxI3BbQODtpaNlwiw== X-Google-Smtp-Source: APiQypJsm4h7zpt6Y+xQGk2M9LUipx189BCY0JB1IRnC1W2D+HvgpPKR93d5nqvK4TPYLbqkFoE8Ew== X-Received: by 2002:a0c:a2c5:: with SMTP id g63mr2357461qva.114.1586905331570; Tue, 14 Apr 2020 16:02:11 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.95.18.252]) by smtp.gmail.com with ESMTPSA id l22sm11648892qkj.120.2020.04.14.16.02.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Apr 2020 16:02:10 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 643AB300945; Tue, 14 Apr 2020 19:02:08 -0400 (-04) Date: Tue, 14 Apr 2020 19:02:08 -0400 From: Alvaro Herrera To: Robert Haas Cc: Peter Eisentraut , pgsql-hackers Subject: Re: wrong relkind error messages Message-ID: <20200414230208.GA27948@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-Apr-13, Robert Haas wrote: > + ereport(ERROR, > + (errcode(ERRCODE_WRONG_OBJECT_TYPE), > + errmsg("action cannot be performed on relation \"%s\"", > + RelationGetRelationName(rel)), > > Super-vague. Maybe, but note that the patch proposed to replace this current error message: ERROR: foo is not an index or foreign table with ERROR: action cannot be performed on "foo" DETAIL: "foo" is a materialized view. or, if we're to adopt Tom's proposed wording, ERROR: cannot perform action on relation "ti" DETAIL: This operation is not supported for materialized views. so it's not like this is making things any worse; the error was already super-vague. This could be improved if we had stringification of ALTER TABLE subcommand types: ERROR: ALTER TABLE ... ADD COLUMN cannot be performed on "foo" DETAIL: "foo" is a gummy bear. or ERROR: ALTER TABLE ... ADD COLUMN cannot be performed on foo DETAIL: This action cannot be performed on gummy bears. but that seems material for a different patch. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services