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 1rrLcr-00057j-Dq for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Apr 2024 17:39:17 +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 1rrLcp-000Ii4-S2 for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Apr 2024 17:39:16 +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 1rrLcp-000Ihw-IL for pgsql-hackers@lists.postgresql.org; Mon, 01 Apr 2024 17:39:16 +0000 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rrLcn-0000v4-LJ for pgsql-hackers@lists.postgresql.org; Mon, 01 Apr 2024 17:39:15 +0000 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-6ea838bf357so3269118b3a.0 for ; Mon, 01 Apr 2024 10:39:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20230601.gappssmtp.com; s=20230601; t=1711993151; x=1712597951; 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=2qpJRAHU3o7PNW6gqlMOSOpB9Khc+G7DWHHZb/fH0l8=; b=z19TTTLBWqLkz3tDJHAdsFTdmuSkb6L8aQbWIzQKoYtE/MBUvDSVMDxHwTVNfiYsUO oKHnfky19JgQfP6zNgg4qs+K0VvRoTrFE/TFX11n1rbQBsBgFT3DVr/h1vt7z8QqCQGd I1QMeqnspLm72+ldu2OUjDuWRfLXukETAUXZuvyD9xGNkkdOS0TfotkYgyy8SqvK2t// mqMmVTSNj/6CggR/lPFsFo0xtRhNJjdWd60CcxEzbTQWDix82iDYylFeGeQo+sBKVcmz sYhkIBQtADWiEs/3buXd0yEBOn91pNNMNG4JPookr2L0XfjvgIwfxn4X3K/dETfM9cjX KyYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711993151; x=1712597951; 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=2qpJRAHU3o7PNW6gqlMOSOpB9Khc+G7DWHHZb/fH0l8=; b=Vg83K57D6FEwPeLRk+/yKpdsi7KBWvSCIKNhZUD0oYZ3vIAr/2IGc+udBcicAI7e8j lnMHmlanwMOevd6Ra9J19d5lUyJ7+SScu4RsO9vTJ90wA9RV4ALQ59taBm0l9TD39tvo tifAzbHuLV1cshc1Ge6e12Virs7XHULmDvmm/sz/z/oO9dkjGKAtHPA/xHe3LWL4aIda UNtqvOxMbkjQQVOoPtqEpnY7sNTkq3urCbD+eo3SXdXqLkYI3Hn4G9xwZoKoDZxCettL tyxIJaSi5/TBuY2kFf5kJSW5XoQWnjaYtqdxuwe5xGTostPWARQLG6hGr3O9ICPefCCm O7hQ== X-Forwarded-Encrypted: i=1; AJvYcCXwS1kX5Q1OAGmEpSKAqdZFHNsLnGXkBc7WsX3e8yJkVmDYoHx1v+iQqXLTm7MbgaNPLjRGckmrfUj+Z3rb94+If6I4OwArI7YFJRri35UJzhyg X-Gm-Message-State: AOJu0YxKDqdri+j2dvMRp6J/vdjUTO6xbd6S1IXBtiMBJYQs8w4XFkqi m+vahx53UDcvIFJzu1iyTlBrtbdejkdaYbYodVHLaLryJzJTA7dhraeyqzNvag== X-Google-Smtp-Source: AGHT+IGURgS5K4Jkh5xcRRjpIJpIl3UNR1KwiJjC3H86w7N6E3mD2hvFrDtcqf+n4MkWEnHlFlcMAQ== X-Received: by 2002:aa7:8889:0:b0:6ea:699f:8dbb with SMTP id z9-20020aa78889000000b006ea699f8dbbmr11111241pfe.21.1711993151636; Mon, 01 Apr 2024 10:39:11 -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 z6-20020aa791c6000000b006eac44e402csm8174516pfa.23.2024.04.01.10.39.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Apr 2024 10:39:11 -0700 (PDT) Message-ID: <8bc6ffe1e5abeac0fdde1a83d95409f0463af013.camel@j-davis.com> Subject: Re: Statistics Import and Export From: Jeff Davis To: Tom Lane , Corey Huinker Cc: Magnus Hagander , Stephen Frost , Ashutosh Bapat , Matthias van de Meent , Peter Smith , PostgreSQL Hackers , Tomas Vondra Date: Mon, 01 Apr 2024 10:39:10 -0700 In-Reply-To: <790773.1711910899@sss.pgh.pa.us> References: <54f190b6c757da2a33cce811949e9dd9601fcba7.camel@j-davis.com> <1632327b74a734f8c434eb75e824160d2b06a697.camel@j-davis.com> <16412b8b7ae443cb7470006beff3011927048860.camel@j-davis.com> <1b1bd1ec39ab3de09a17bf7b241021067e5bd63c.camel@j-davis.com> <2bce855db8259c5672a09f863a307ca07b967b68.camel@j-davis.com> <5e94c358caedf2a231dd71624c3578db7227a265.camel@j-davis.com> <4afa70edab849ff16238d1100b6652404e9a4d9d.camel@j-davis.com> <3df03aa65aa6ea3a76582e1a792e422dc5c32ad3.camel@j-davis.com> <718fa933c2c58d0ecc61995ab5c7ca1fe78d6369.camel@j-davis.com> <790773.1711910899@sss.pgh.pa.us> 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 Sun, 2024-03-31 at 14:48 -0400, Tom Lane wrote: > What happens when > somebody adds a new stakind (and hence new pg_stats column)? > You could try to add an overloaded pg_set_attribute_stats > version with more parameters, but I'm pretty sure that would > lead to "ambiguous function call" failures when trying to load > old dump files containing only the original parameters. Why would you need to overload in this case? Wouldn't we just define a new function with more optional named parameters? > =C2=A0 The > present design is also fragile in that an unrecognized parameter > will lead to a parse-time failure and no function call happening, > which is less robust than I'd like. I agree on this point; I found this annoying when testing the feature. > So this leads me to suggest that we'd be best off with a VARIADIC > ANY signature, where the variadic part consists of alternating > parameter labels and values: I didn't consider this and I think it has a lot of advantages. It's slightly unfortunate that we can't make them explicitly name/value pairs, but pg_dump can use whitespace or even SQL comments to make it more readable. Regards, Jeff Davis