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.89) (envelope-from ) id 1hMe4o-0000fT-JM for pgsql-hackers@arkaria.postgresql.org; Fri, 03 May 2019 19:42:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hMe4m-00063T-J9 for pgsql-hackers@arkaria.postgresql.org; Fri, 03 May 2019 19:42:32 +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 1hMe4m-00063L-6D for pgsql-hackers@lists.postgresql.org; Fri, 03 May 2019 19:42:32 +0000 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hMe4i-0003kE-SV for pgsql-hackers@lists.postgresql.org; Fri, 03 May 2019 19:42:31 +0000 Received: by mail-wm1-x341.google.com with SMTP id t76so8415130wmt.1 for ; Fri, 03 May 2019 12:42:28 -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:references:mime-version :content-disposition:in-reply-to:user-agent; bh=KPS26xe34zrAGYYv1yKh+qsaewTEjAgxSTq+SAbGLGc=; b=hgdXiWTrmOTGNhIL+/E5TkvDuHrbhKBj7Y5DAU6qiPJ0u5UpGcnCZBK9rraEj9ZjTk 2B3UpYn3y8NO/TbCSNh/wePwLf/NJNWOdGNTHBelXnB9rorHcDaBIWBqnZfOpk/2cRtG 624vOJJ3drDdIRPRWlSIzpCe9vG5mDhVsszBkU6EXJZEdgckNeyjAjQKh0Q2+FMa/d3y FBTRpCZRQ7Xvm7Ot5CrtRxwv1V+UAcaWVSyf9ca5KzPgSD/j4sXsuD/xe2qKz7xOeO86 OqPLIFtsYuEtubDAtfezZomNCtxBFpRRRXn1m6yq5MHK0Q3bGuIMunwxjhCj/yY1kyDW e5TA== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=KPS26xe34zrAGYYv1yKh+qsaewTEjAgxSTq+SAbGLGc=; b=PF+hGm/ASwSzYphqvejCi92rkpx4Puo4wB9uk8L/HelmFN09HU5TIWlZ04Q2PZGFKP 7MMFuAUBoZBs4PEG8KbKcX+jsVr0EfkFjHiqmmuoofEj5PLuDUsaYNVbYFYBMbS/jcZc O40PJ2HpcL6pUli8K53A+IZVg6AZopL3QZtmXcitwqj6rdXyaXa5qTFsIJxxCO+i+7nJ YgIlJHYDECFx/ksho9QwgtcpI1cd6JiKkOV+q/O0xH2vyb//NtzB/4XU2u8SVUiF4/Js NHfAwid3ds0at8IUb1C/BqRabclMqq4Hn5rGHbv9U3MXG/bQ1B6Wkdn0gRFqXVAAsupM Inrg== X-Gm-Message-State: APjAAAW6+hXV1XTqLINcBJTdOG9l04dHsAYUOiUzJopXd/u7fYUIENFW YuN9oYmno2RKAssDanxB5vVULg== X-Google-Smtp-Source: APXvYqxfTM1tpdseBN+NJ7mGcYIiagdXg72eela7G5XeorJ4breIPYddcVw393AoSrvRPIzYmsoGsA== X-Received: by 2002:a1c:c54c:: with SMTP id v73mr3939018wmf.85.1556912547236; Fri, 03 May 2019 12:42:27 -0700 (PDT) Received: from localhost (ip-86-49-243-43.net.upcbroadband.cz. [86.49.243.43]) by smtp.gmail.com with ESMTPSA id c9sm1879459wrv.62.2019.05.03.12.42.18 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 03 May 2019 12:42:18 -0700 (PDT) Date: Fri, 3 May 2019 21:42:17 +0200 From: Tomas Vondra To: Tom Lane Cc: Alvaro Herrera , Pg Hackers Subject: Re: error messages in extended statistics Message-ID: <20190503194217.53bub7jqml43kml4@development> References: <20190503154404.GA7478@alvherre.pgsql> <10879.1556900496@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <10879.1556900496@sss.pgh.pa.us> User-Agent: NeoMutt/20180716-1444-295967 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, May 03, 2019 at 12:21:36PM -0400, Tom Lane wrote: >Alvaro Herrera writes: >> Error reporting in extended statistics is inconsistent -- many messages >> that are ereport() in mvdistinct.c are elog() in the other modules. >> ... >> I think this should be cleaned up, while at the same time not giving too >> much hassle for translators; for example, this message >> dependencies.c: elog(ERROR, "invalid MVDependencies size %zd (expected at least %zd)", >> should not only be turned into an ereport(), but also the MVDependencies >> part turned into a %s. (Alternatively, we could decide I was wrong and >> turn them all back into elogs, but I obviously vote against that.) > >FWIW, I'd vote the other way: that seems like a clear "internal error", >so making translators deal with it is just make-work. It should be an >elog. If there's a reasonably plausible way for a user to trigger an >error condition, then yes ereport, but if we're reporting situations >that couldn't happen without a server bug then elog seems fine. > Yeah, I agree. Most of (peshaps all) those errors are internal errors, and thus should be elog. I'll take care of clening this up a bit. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services