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.94.2) (envelope-from ) id 1t1bzY-00H3y3-Og for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Oct 2024 01:41:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1t1bzW-00DKU0-RJ for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Oct 2024 01:41:23 +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.94.2) (envelope-from ) id 1t1bzW-00DKTr-C5 for pgsql-hackers@lists.postgresql.org; Fri, 18 Oct 2024 01:41:22 +0000 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1t1bzT-001dNC-M3 for pgsql-hackers@lists.postgresql.org; Fri, 18 Oct 2024 01:41:21 +0000 Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-2e2bb1efe78so1120655a91.1 for ; Thu, 17 Oct 2024 18:41:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20230601.gappssmtp.com; s=20230601; t=1729215677; x=1729820477; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=L4KXUIu+cwriNp/NmZTkp9/6NwKYkCeTuumZllLBZww=; b=DE2vueQ9djuPl/Q+BpHFM/6J9Ks1m7ToWvdKRrWtPvs6UCKk4nrhnlelhixa4tM1aC 0bZgB3jrI0Lz7Wt6qInYrkkJKwWtUEjgOuGHETXB5E7do57bCo3egQMCtqNXNE9F5OpL T1Vf8cgAkgyc5ch9CUNMVoOzDMx8pLrcfGMmQ3q4M+5ETc/ypgEIbVf4WwBUPvw/vRnp ZBXPef+Oyp+FRy9CZyOy3vln9gSYwcp5+rymmLnTkmqbU+EA8ciK/bNLKTAbIJUJt9Mo nrhEIE7pPemdDfix623T82sy8HxxB2fCCkfi++Mcc/z5g/NgbSzPWgmrJeFIz2kIlsMN RCoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729215677; x=1729820477; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=L4KXUIu+cwriNp/NmZTkp9/6NwKYkCeTuumZllLBZww=; b=AZ6ybu/tOTTP7Xv8YlxJbYiOoC/48htqvCwMW4fNQR0CWyFecU2XwE56PMEckMrrOc wr+gOkrmeG0GHOz94XB/bRTPAq/mtGsEv+a+oGd69lNsbJ1VQK5lTL1S3+O4d/gvTuRT 0dIoCrLHSjZOyZeAYxQIDT31+XPEBzIxOW6+UuQCpeRxJvthxIIoYZPEZrUm7oomzxVT Znjrp+FNQOWfxgkt5OXKmluRkMa2FRup7oevVZNnkBU/huJuvp6n9/F3u9E5ysOgdJqb 4sabC2tvkM/rMpEJVNEQQobuTPj+KB79tIiM9LJlXnrdYm+ilZwn5/tP30/gVB6b6oda VjTg== X-Forwarded-Encrypted: i=1; AJvYcCUr6jUlWfCgbmpiUxDvOilnofc9tRiAMdG3ijhzviyHD8jqprFnAElEkfos55o0RmebMbaMkWM05135s8Wz@lists.postgresql.org X-Gm-Message-State: AOJu0YzGBSCPWolSBuXuRQKMurOjV3E6tuEmZeq0w1shl41a8dZXwGAO rXzyeCBlKd1hRT76X/iKlqouQesmKeBk8pawXghamHO4M1QA+VW9NG3AidP+3A== X-Google-Smtp-Source: AGHT+IER/rplspYVZdM5Ezg/a18+U+/OcKqqzCQolk7EQl0CkzchXeF4EUVV791eE6pA0qMX6vwWSw== X-Received: by 2002:a17:90b:391:b0:2e2:7f8f:3ad5 with SMTP id 98e67ed59e1d1-2e3dc1d971amr7995820a91.2.1729215677267; Thu, 17 Oct 2024 18:41:17 -0700 (PDT) Received: from jeff-laptop.lan (c-76-102-242-158.hsd1.ca.comcast.net. [76.102.242.158]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e55da79303sm602695a91.52.2024.10.17.18.41.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2024 18:41:16 -0700 (PDT) Message-ID: Subject: Re: Statistics Import and Export From: Jeff Davis To: Corey Huinker Cc: "Shinoda, Noriyoshi (SXD Japan FSIP)" , jian he , Matthias van de Meent , Bruce Momjian , Tom Lane , Nathan Bossart , Magnus Hagander , Stephen Frost , Ashutosh Bapat , Peter Smith , PostgreSQL Hackers , "alvherre@alvh.no-ip.org" Date: Thu, 17 Oct 2024 18:41:14 -0700 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4-0ubuntu2 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, 2024-10-17 at 20:54 -0400, Corey Huinker wrote: > There is some uncertainty on what, if anything, should be returned by > pg_set_relation_stats() and pg_set_attribute_stats(). ... > This re-raises the question of whether the pg_set_*_stats functions > should return anything at all. What is the benefit of a return value from the pg_set_*_stats variants? As far as I can tell, there is none because they throw an ERROR if anything goes wrong, so they should just return VOID. What am I missing? The return value is more interesting for pg_restore_relation_stats() and pg_restore_attribute_stats(), which will be used by pg_dump and which are designed to keep going on non-fatal errors. Isn't that what this discussion should be about? Magnus, you previously commented that you'd like some visibility for tooling: https://www.postgresql.org/message-id/CABUevEz1gLOkWSh_Vd9LQh-JM4i%3DMu7PVT= 9ffc77TmH0Zh3TzA%40mail.gmail.com Is a return value what you had in mind? Or some other function that can help find missing stats later, or something else entirely? Regards, Jeff Davis