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 1rrmA4-002emz-NK for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Apr 2024 21:59:21 +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 1rrmA2-00CaxM-HZ for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Apr 2024 21:59:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rrmA2-00CaxE-7z for pgsql-hackers@lists.postgresql.org; Tue, 02 Apr 2024 21:59:18 +0000 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rrm9z-000Ft4-G8 for pgsql-hackers@lists.postgresql.org; Tue, 02 Apr 2024 21:59:16 +0000 Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-2a074187a42so4274244a91.0 for ; Tue, 02 Apr 2024 14:59:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20230601.gappssmtp.com; s=20230601; t=1712095154; x=1712699954; 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=eyYVljyTMFKI9hjhM/U/eM1MGI+K5cArogSAb9KiFk0=; b=OWNPixTPkvwRTE3+0oAjDcdPkf+csyQFtZF0XwT79Lq8RZYz+8p5qCbVDYFbZPRT2V 0Ug8gU1GCabP+KEEEbvlfzlI5TcndMYpLW85ivsrS8BKc//2I101UaKNz/Ul6h24VRaI A0mGfLfwl0jN3NcfT+IlJe0q0DFXwKajlF4YxQmTNVocSWTkU1EnTbJcWHCKD7BWrPCg hQQFWjolgF/LkEiRdI23gVEtEo+dslpC//IkpCiRNKR8IJb6k3MTv4wqHZF+5IWozflz 4bP2I7p/rYcFRGcdBT3Qxk1Ak3pczaoD5tf+O/bSuWhS8Fb/YrMUKbNsAtrAFqpYUrzW wNyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712095154; x=1712699954; 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=eyYVljyTMFKI9hjhM/U/eM1MGI+K5cArogSAb9KiFk0=; b=Woo5NjCge64ApNUlbqlQOR1C2qDfR+VgywKanFCjmSUsmXQeCh/PMn4IQCdhO4Xsx2 J9ExSYhgrVdG3NcN4Og3kFzPkEPDxLoyUu54GoykmrJFU5VQkFBuTI18UMA4luvTES+F d/xRDX7ZEj3Y/WHUWaotJpsDYANh6fKJmr8/DWjPe0GI5W4ZLbNlLArQAfypq1GwpBSM lmSlrNbKbg2JqIxxRiL7q53mb+9bJfJ/UD5F8trIbZz59bHcypys+wKJ2BDl/yjRuKK9 3X4R9c12z6UFSR7ZBzGP49sCNxCPLaakWdaTB6fXEr6K9gXSC7LuEIuERYi2yW0V94rW xQzQ== X-Forwarded-Encrypted: i=1; AJvYcCU3n2ro0QZcj/gdmFpUVtcvOrdCiHqH+vWeZz1/kJuZz6HEpyJqDKkHeDbHLu9SkG4soqsh48Ts/WbVNt5w2r0kc90m1mHRjx0f5lYxqsKTpX6D X-Gm-Message-State: AOJu0YxNAGbFxxEBKXOa6Rw+an4Nmk7v/D5HLRsaKVYG3o0kTsD+BoWZ Sp8ArFoASOPDqgQwS63hE4bqKZxPkTBB1fTc2LNu33c/+/x/rHXlKAl6ZB8CQg== X-Google-Smtp-Source: AGHT+IHBdCxnrl53hIuy641dkcItgTRi8sWTtkAHPHUEjd8nna7mEsCpj5DUHT9EovE5aaxpPMM/hA== X-Received: by 2002:a17:90b:228a:b0:2a2:4135:5310 with SMTP id kx10-20020a17090b228a00b002a241355310mr5379877pjb.12.1712095154521; Tue, 02 Apr 2024 14:59:14 -0700 (PDT) Received: from [172.24.2.15] ([12.126.244.130]) by smtp.gmail.com with ESMTPSA id c1-20020a17090ab28100b00299101c1341sm10260160pjr.18.2024.04.02.14.59.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 14:59:14 -0700 (PDT) Message-ID: <06286ee47fa4b06b6e7f08da21958d7e35525ed4.camel@j-davis.com> Subject: Re: Statistics Import and Export From: Jeff Davis To: Tom Lane Cc: Corey Huinker , Magnus Hagander , Stephen Frost , Ashutosh Bapat , Matthias van de Meent , Peter Smith , PostgreSQL Hackers , Tomas Vondra Date: Tue, 02 Apr 2024 14:59:12 -0700 In-Reply-To: <1841621.1712093467@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> <718fa933c2c58d0ecc61995ab5c7ca1fe78d6369.camel@j-davis.com> <790773.1711910899@sss.pgh.pa.us> <8bc6ffe1e5abeac0fdde1a83d95409f0463af013.camel@j-davis.com> <1141637.1711994977@sss.pgh.pa.us> <1215956.1711999455@sss.pgh.pa.us> <1321788.1712005745@sss.pgh.pa.us> <1328631.1712008078@sss.pgh.pa.us> <7d37175cd5b56ab04940ed6b5a72354ae90783ee.camel@j-davis.com> <95a34a5131611e1a987a6fe538a44! 1c33ca52842.camel@j-davis.com> <1841621.1712093467@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 Tue, 2024-04-02 at 17:31 -0400, Tom Lane wrote: > And that means that we don't need the sending > side to know the element type anyway. We need to get the original element type on the import side somehow, right? Otherwise it will be hard to tell whether=C2=A0'{1, 2, 3, 4}' has element type "int4" or "text", which affects the binary representation of the anyarray value in pg_statistic. Either we need to get it at export time (which seems the most reliable in principle, but problematic for older versions) and pass it as an argument to pg_set_attribute_stats(); or we need to derive it reliably from the table schema on the destination side, right? Regards, Jeff Davis