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 1hMaOs-0007Ia-A4 for pgsql-hackers@arkaria.postgresql.org; Fri, 03 May 2019 15:47:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hMaOr-0000vC-1I for pgsql-hackers@arkaria.postgresql.org; Fri, 03 May 2019 15:47:01 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hMaOq-0000l6-GS for pgsql-hackers@lists.postgresql.org; Fri, 03 May 2019 15:47:00 +0000 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hMaOn-0005aj-9u for pgsql-hackers@lists.postgresql.org; Fri, 03 May 2019 15:46:59 +0000 Received: by mail-qk1-x742.google.com with SMTP id z128so1354164qkb.6 for ; Fri, 03 May 2019 08:46:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:subject:message-id:mime-version:content-disposition :content-transfer-encoding:user-agent; bh=oewlhOjZ3CDMe8+SigoeS4dheVp8qJRM9DsEeKARv08=; b=oABuyr19LcuWi5uTS7urn2nTLfuvGrKfRcmIx0P8bADBDFDfkXE5otyUNrlt4Pr2a4 RGLwzX/kLlFjsgimSBYFucLhoXzuiX+v/tGr21c6K/XG+1r8AkbDrw3fLxK9PmZ747d/ BtEXgvrYLX666ka6ZFQOWiLd3EJounbPQpcz3Y5MhiPgeiC2YXKJRbQ460lMJLzBkMee 4dZmXnd9xbDUJawhOUzWSDz/2zjd7s01xywphbJRU7Q2AP6M+zHJIpZ3C7TRPn5wMejy aA6Jt7kDHMfxRuTTd+R+QvEywiF1daDIxpD4ar7zGbZjwbZvO+G97FYSC7K920U3KH9Q O/dg== 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:subject:message-id:mime-version :content-disposition:content-transfer-encoding:user-agent; bh=oewlhOjZ3CDMe8+SigoeS4dheVp8qJRM9DsEeKARv08=; b=WKlR9mOHf16KAVRahkJ3x2CHC8f7BYJbvbljSmafhJTC2nBUo7V+rM1KP2cV6o1Jra 1YyocRQtFiluL36aENMU5DAdnlceXcKKSP0ZDdXLaxmAqsQXgBdb9go2gIslZozJUqC6 8C6UA9kMBjx7nbZK8kXVnlHJMdEzGOYWgiWc3oQrYNWGbIzj+Qi7o3f3dEGPrbuiOPhd Sn5/B+6bjHhdL4fxj6P9oQefrrHWWnpSqAcQZwIocWMuIv18nzpWbor16hFuzMLLK3+4 z5WkRDv2BJYhqOJqGu2J8SZvEtl+Y8ye/AZI2MSsAiqNqS0ru7gi0mjtrsM2rSqgX8RY aTxw== X-Gm-Message-State: APjAAAVu8KE7etnG3QomzF6cWV2IYUnVkp8OwhRq2bZECeUoyVX8hb62 iICZyfLXOadAYw4dzYXoTykicw== X-Google-Smtp-Source: APXvYqwsBTdfdmzV+ucRIK4aRQe+TA9Dk3HLvc2EJenS77fxgGAdxSqg8SNyRBfD6nOc8Qscx6TdAg== X-Received: by 2002:a05:620a:1486:: with SMTP id w6mr8180454qkj.4.1556898416593; Fri, 03 May 2019 08:46:56 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([191.125.99.204]) by smtp.gmail.com with ESMTPSA id z25sm525255qtj.2.2019.05.03.08.46.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 May 2019 08:46:56 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 44B92120D6B; Fri, 3 May 2019 11:44:04 -0400 (-04) Date: Fri, 3 May 2019 11:44:04 -0400 From: Alvaro Herrera To: Pg Hackers , Tomas Vondra Subject: error messages in extended statistics Message-ID: <20190503154404.GA7478@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello Error reporting in extended statistics is inconsistent -- many messages that are ereport() in mvdistinct.c are elog() in the other modules. I think what happened is that I changed them from elog to ereport when committing mvdistinct, but Tomas and Simon didn't follow suit when committing the other two modules. As a result, some messages that should be essentially duplicates only show up once, because the elog() ones are not marked translatable. 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.) $ git grep 'elog\|errmsg' src/backend/statistics dependencies.c: elog(ERROR, "cache lookup failed for ordering operator for type %u", dependencies.c: elog(ERROR, "invalid MVDependencies size %zd (expected at least %zd)", dependencies.c: elog(ERROR, "invalid dependency magic %d (expected %d)", dependencies.c: elog(ERROR, "invalid dependency type %d (expected %d)", dependencies.c: errmsg("invalid zero-length item array in MVDependencies"))); dependencies.c: elog(ERROR, "invalid dependencies size %zd (expected at least %zd)", dependencies.c: elog(ERROR, "cache lookup failed for statistics object %u", mvoid); dependencies.c: elog(ERROR, dependencies.c: errmsg("cannot accept a value of type %s", "pg_dependencies"))); dependencies.c: errmsg("cannot accept a value of type %s", "pg_dependencies"))); extended_stats.c: errmsg("statistics object \"%s.%s\" could not be computed for relation \"%s.%s\"", extended_stats.c: elog(ERROR, "unexpected statistics type requested: %d", type); extended_stats.c: elog(ERROR, "stxkind is not a 1-D char array"); extended_stats.c: elog(ERROR, "cache lookup failed for statistics object %u", statOid); mcv.c: elog(ERROR, "cache lookup failed for ordering operator for type %u", mcv.c: elog(ERROR, "cache lookup failed for statistics object %u", mvoid); mcv.c: elog(ERROR, mcv.c: elog(ERROR, "invalid MCV size %zd (expected at least %zu)", mcv.c: elog(ERROR, "invalid MCV magic %u (expected %u)", mcv.c: elog(ERROR, "invalid MCV type %u (expected %u)", mcv.c: elog(ERROR, "invalid zero-length dimension array in MCVList"); mcv.c: elog(ERROR, "invalid length (%d) dimension array in MCVList", mcv.c: elog(ERROR, "invalid zero-length item array in MCVList"); mcv.c: elog(ERROR, "invalid length (%u) item array in MCVList", mcv.c: elog(ERROR, "invalid MCV size %zd (expected %zu)", mcv.c: elog(ERROR, "invalid MCV size %zd (expected %zu)", mcv.c: errmsg("function returning record called in context " mcv.c: errmsg("cannot accept a value of type %s", "pg_mcv_list"))); mcv.c: errmsg("cannot accept a value of type %s", "pg_mcv_list"))); mcv.c: elog(ERROR, "unknown clause type: %d", clause->type); mvdistinct.c: elog(ERROR, "cache lookup failed for statistics object %u", mvoid); mvdistinct.c: elog(ERROR, mvdistinct.c: elog(ERROR, "invalid MVNDistinct size %zd (expected at least %zd)", mvdistinct.c: errmsg("invalid ndistinct magic %08x (expected %08x)", mvdistinct.c: errmsg("invalid ndistinct type %d (expected %d)", mvdistinct.c: errmsg("invalid zero-length item array in MVNDistinct"))); mvdistinct.c: errmsg("invalid MVNDistinct size %zd (expected at least %zd)", mvdistinct.c: errmsg("cannot accept a value of type %s", "pg_ndistinct"))); mvdistinct.c: errmsg("cannot accept a value of type %s", "pg_ndistinct"))); mvdistinct.c: elog(ERROR, "cache lookup failed for ordering operator for type %u", -- Álvaro Herrera Developer, https://www.PostgreSQL.org/