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 1w63pf-003ub0-2f for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Mar 2026 09:50:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w63pe-008qMr-1D for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Mar 2026 09:50:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w63pe-008qMi-0G for pgsql-hackers@lists.postgresql.org; Fri, 27 Mar 2026 09:50:22 +0000 Received: from mail-qv1-xf31.google.com ([2607:f8b0:4864:20::f31]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w63pb-00000001SG4-3GTk for pgsql-hackers@postgresql.org; Fri, 27 Mar 2026 09:50:22 +0000 Received: by mail-qv1-xf31.google.com with SMTP id 6a1803df08f44-899fb2b94c1so21999796d6.3 for ; Fri, 27 Mar 2026 02:50:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774605019; cv=none; d=google.com; s=arc-20240605; b=F0oosv3iDVZUEtQi/t+i8aGM3/C0aCHI6RZ52NvCu6fZE1YhJ8+zRSOdX15NuQ2BPe ckpKlmRkLQQg+74kCnuY0L9vHM0kmho0/XYWxppgszt1WXXh3q6pOwv81lELDFkiCPlF 4zN7tobkkcHotsaTX3YGsx0HjeXvyi3YxIU43RRfJhAsUgocwkYOJ9elbva1O1Wta0YR vRIdcGJQx+mSy8A51ug0VGYqoVI5UZVPaUxHoRfbA8+437DEPmiRTa61nLtMD4sj+ofe XEt/WLPVOOiR3CchIWbl8c5EiaHfANFm73rXhAagHdVoREBqlnDMc/7ijxohQpi2gbIn GGFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=aH6/1vaEAsx0AmB8sZPKnTIMjh/lLbMKEXAeLAjkiRM=; fh=dXqfafWZe1+QErhiNQyxvQIOLTcORXiaGPd9FZPoLCA=; b=Dl0/c1lwoX8j6bufGM+vxFZap4zgfaAIsVXm4b/nns9buCnhhrQWkvS7w31H/Jaojl whlP5mZ3pw2jnhiw4kKSv9q7Y+zb0/mI7Z6Al82UMbGF/+A5V9T1JuPXYubBlOHeqWk0 99CbdFMYLh9Em0AYvnUfHv2a0XWRKEM8zLL8SNikj7EOG2hiumInXIhI+s1ylCa4chJ/ QaMrd2oBsEaH/dzktXaDs9x2F0BQ6OvB02auuxUDUXnb8eT4NGBRtIT2EZi3yR9yzash DIeCjHD2rdBxVV47YnktigTjC/Nqwfm3YoB9WLZx56zierlGIMnIvh/yRWcm6I/8/Tc3 BzQg==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774605019; x=1775209819; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=aH6/1vaEAsx0AmB8sZPKnTIMjh/lLbMKEXAeLAjkiRM=; b=pFRAtXxQbNnZkCHtmfbWD5/Jm/HIM0wPTlfTXvl0PBZ0N54/fmYoacq1M8TlOYaSWA DGsbMDJPzbJAacZpiuJc/ta/2w4L4uVAub4pq9AiAuf8sOtpC1XBSPSdCEt8OCrAkolm F5L+p81hJ5YTrMsexpb87zlofdKrWFEf98fjKv/v+baH0XzWLcdTeRseZYHmZCThc+c8 jewPBkeP8cwgyoobg9u+fp0LrN5XPpIueMUhma4Y9F3Iqx/MTp8tGIDTb+CcyYQ3eRu1 U6Uk7tibqV69Q0VOr0Bh5QlmKH9Vc7xHs7j2VF/NH+N1qsef6as4dc2y3ujiafS3+Tgq sSgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774605019; x=1775209819; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=aH6/1vaEAsx0AmB8sZPKnTIMjh/lLbMKEXAeLAjkiRM=; b=o2impSblwN+Ae5dB7yoMsU79ZBCvoJQhvfWKHZ/znRh9wCh1Yi19v0PeMKB6Wo6CR8 d9WrTuGOMjDsuIOc6FgLIYpYtmdHjtspLmq4XwpL77pCcdX7Zx2XreoSmH4RWhfZFMRD SuMzknlbMzvHOpQQNoMZoTGLV4AtMIoOPlanGlmrSj3x5pjt2JJ4SsF5V4XPbpcbcAeM 6rJD6kQvR5yoJM2iH8lueHH3rOy1cYoc9VWAdfwlvJ7DorlJHHkgQQLpdoh0HhyyKIBa YIi3DBTjQKEaM1xfiYETGqm7DCMDUQduHCTo3rgnle0BXQjEAVVBLZiKZQCB8ey6BGkr 2c5Q== X-Forwarded-Encrypted: i=1; AJvYcCWHpOjHEs2y94m446nTU3GhQKvUiEnj1/uQWr11uczJmQxalIDkQ/eVEX1S37gOfFAC2i/xNpCzgqiwisp4@postgresql.org X-Gm-Message-State: AOJu0Yzsf9SQyUeDGmWRhwhZkZ/nvwRwMbazZ7Fs2iT1BxMLt3UZx6Dm 5A+oBgPfvZAwRAKX4B0cJYaojeepEo0FS8xwdFf4ExZD75NwBLGJndGjaaD5neangvQMH6M+cuA 7elehut8xuXSaoUdtnc+m9urkjauNzcg= X-Gm-Gg: ATEYQzyzzZZOBC6MNvooz33d0jkThFmnMHPEYMy7jsdcTGXhJvfmU9NjjY2uP0eru/N /S0KeZWiHpXx3s11Td2cif2T1ikCL5obY3vOP2pOTMaQhERethLaUWhO4q2G4a8f3RyF725X/Xp XntIcLufyS+KeDGoJXMecO7FrLcOTHGVcZV216ByQy9PeCmaN0YCts7pOru+++Ea/HUOdCcozlz 0oZ0TzuDnbiSjfZlcp4i4jQ/xrK5aOzL7E1SEllIKDt3LpjTQkGdqfueRG1EL9ybcECga/ebfNB cDO4qUWsaHbAn37EQgvv+2a2DlUiGrEOEZPJPv9PpQ== X-Received: by 2002:a05:6214:4a04:b0:89c:d408:b52b with SMTP id 6a1803df08f44-89ce8f436f1mr20404296d6.48.1774605018738; Fri, 27 Mar 2026 02:50:18 -0700 (PDT) MIME-Version: 1.0 References: <20260324203430.411331c59ca462457ec0aa8b@sraoss.co.jp> <20260325131548.4c9a0c8d05a422021b1ba76c@sraoss.co.jp> <20260327134637.957f51dafa2182a717a4cd78@sraoss.co.jp> In-Reply-To: <20260327134637.957f51dafa2182a717a4cd78@sraoss.co.jp> From: Dean Rasheed Date: Fri, 27 Mar 2026 09:50:07 +0000 X-Gm-Features: AQROBzB3J-DdzPR_LF8IfiQTHH3FoVsjwbzUrIE5Iyph2u-pf1gWmhOYIYJMemA Message-ID: Subject: Re: Adjust error message for CREATE STATISTICS to account for expressions To: Yugo Nagata Cc: John Naylor , Michael Paquier , Pgsql Hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 27 Mar 2026 at 04:46, Yugo Nagata wrote: > > On Fri, 27 Mar 2026 07:45:37 +0700 > John Naylor wrote: > > > On Fri, Mar 27, 2026 at 6:23=E2=80=AFAM Michael Paquier wrote: > > > - errmsg("extended statistics require at least 2 columns"))); > > > + errmsg("extended statistics are not supported on a single column= "))); > > > > > > Now our documentation also tells that the former message is not the > > > preferred project style (full sentences usually avoided in primary > > > messages): > > > https://www.postgresql.org/docs/devel/error-style-guide.html#ERROR-ST= YLE-GUIDE-GRAMMAR-PUNCTUATION > > > > My reading of that is that hints/details need to be complete > > sentences, and primary messages don't need to be. If the obvious way > > to write primary message is with a complete sentence, I would say > > that's fine, but I don't have a lot of context here. > > > > > Perhaps something like "could not create extended statistics" with a > > > hint describing the cause would be better.. Full sentences usually > > > apply to errdetails or errhints. If we're on it, we could just as > > > well improve the whole thing, I guess? > > > > I don't feel strongly either way, so in that case I would default to > > not changing to errdetail. Looking elsewhere in this file, however, I > > do see some messages with "cannot do X because ....", and I'd be more > > motivated to turn those "because" phrases into errdetails. > > I don't have a strong preference here, so I'm fine with either approach. > I also agree that moving "because ..." into errdetails in some longer > messages makes sense. I don't think it should be a hint, because that's more for suggestions on how to fix the problem. Given that the user just tried to create extended statistics on a single column, they're probably not interested in expression statistics or multivariate statistics, so a single short "not supported" error seems sufficient. If we were to give more detail, it should probably be to point out that regular statistics will already be built for single columns, which is why single-column extended statistics would be redundant. So perhaps something like this: Error: cannot create extended statistics on a single column Detail: Univariate statistics are already built for each individual table column. Regards, Dean