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 1wZnQb-001Hvy-2v for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Jun 2026 10:23:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wZnQa-005Uuo-20 for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Jun 2026 10:23:24 +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 1wZnQa-005Uuf-13 for pgsql-hackers@lists.postgresql.org; Wed, 17 Jun 2026 10:23:24 +0000 Received: from mail-dl1-x122d.google.com ([2607:f8b0:4864:20::122d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wZnQX-00000000tSi-41Gx for pgsql-hackers@postgresql.org; Wed, 17 Jun 2026 10:23:23 +0000 Received: by mail-dl1-x122d.google.com with SMTP id a92af1059eb24-135e7f4a295so565914c88.0 for ; Wed, 17 Jun 2026 03:23:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1781691799; cv=none; d=google.com; s=arc-20240605; b=ZVm+0PGdQHohCAWRb9M9TApxZgddJbQVVlmC13LwlM7AQExddc3Yy7YT1JfwyDuEE1 10Msh1vhIzs2EpcIev8kfYisxyOiR9ivQXdHDPS03mNN3b2El9l3TRdgsOhKNaq6LwFF LrZMybAGbPAcA4FatGphlxn0pMg2Zi3c6ent7ru3nm5W03IyoVpELyIbFjSEcIPkjgQk QXcKa7S6fVrax+Zzc6Y6sxxYAdcrodN89xUxFAXMLnfz0WgmJXpqinCCoKTAoTrgzUlY bRA6q9SJL8Tbi3V6fhIH6zNnKZ8aTr+MSei/C8T0920jkHQyLaRlhny8PW+HOpNtxzRL bvew== 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=r5uLw/BLT4AcI7gZ9NZGXNmngs0tHG6lGRWiiLpHauM=; fh=EARPdaXsyxEA7trSxoVmg9zzD2VNkBkFKr6pBcoynZ8=; b=lsrCjCobkASDkuT6duPxIYwWm328mXYCNxKULSMHUmEVRAcJiod6i86cOz7pQKik29 f44NU4g9kHGFBOqGYsRfw3Zresg7Jxossk+yEiqRciypaoNywYJzmhjTZ2eL+UJdTQS9 GCI7ETbA4zlEAA3VmFuDJ+vWRNQF1F8qLtTXGM0eryKqr/kkAHIyJbTXhHIv/OQIoqkP 17osSOPz2SKgyJjxj4pjQghZvuPFEmvGZ8fxN7ozKr7/houyUx4iWVLBixinMjIwB9K9 lA3SfBoBYzfOGYBgoCbMChKD474sdJImmeuqBc/G4ap05QlIke0QlTH9ofpiJvsDh9VZ 2L3Q==; 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=1781691799; x=1782296599; 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=r5uLw/BLT4AcI7gZ9NZGXNmngs0tHG6lGRWiiLpHauM=; b=HCQd70oGqWoIzN8Vy/ar5uCVAQSnPoHi7ykslxdGxcZQzYXsWYP/87Kk0lXrC1QBDC 0SrphHewFVIVTSf3qVHKYySilEKAhVnbXJx1v1BzbELqe8hX88tmIzwPpyGGtxOeb9IZ f2SLRGi3cSA1d0XX3IPjVK/iPo2h5FvVpaqlWueZVaOGl/3WBcVX0wYJ8/uJdh9lOX47 2kVY9NbWMcUwKcgpax5PAVDHE0bf+WXv88EfZI9DgxyShV6u4jYewdZNP2j3xOULuo6B G5OwOglTnB33U8BEFZQ7fw7YMWHz/aE5xjQnvLB7W+Hul3bAzondz2cfgz301IJJidz5 fsFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781691799; x=1782296599; 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=r5uLw/BLT4AcI7gZ9NZGXNmngs0tHG6lGRWiiLpHauM=; b=d0EXZtmlitx/T80gPHYB4ASRhaL6JZPkgOf/Ic9X+q3X+NW5EuFuWZh/kMj7Y3I0H+ blNfrzSNlzyuiyDM4XDQj4WSNIqfE1avfg/JTSM1+tqs1LxhpCHLDjEQ8xe38818r3pL 9HrwrERGb3rnDDVpVoCUx7wB7LctIKPd33ME8ZMSUTqcaZ7GgRGsCVw15ZuLa8GE9W5c O1aDvFyV1wHycdbnfTL3iHpoEKk5GB3lkrg7dC4a/fDbt2L8nVbN7cAn8kOuOOWeRE0b 5HWn+Ks9UTgZHgBAWluIw/ZfgxGdT/DaaRhuRR0L0M2bhNxiLGPoH0Ulj+8y3l9dATos eADg== X-Forwarded-Encrypted: i=1; AFNElJ+9OMkIvNTm/9iwoR7X+EsfFGrYxjsMF4QWjS9iImM7XiNll608kmHSoFl0b3Be9PpkLt1voDIaCq2Cnp0x@postgresql.org X-Gm-Message-State: AOJu0YxdBOOV95WS2Li0l8slSUiwJhMRI/jIzyam49YiqshSHsGA1WHY 3MB7MD3CSyif2jr/UsJQaaeGhl4RoFjDOjHyVuECLbQ6eyxVm+yMWFXTOs1awjnRgrAXZgBlCCp DLTrU79sqSzt9Xx3PK0WstkX9NjxEXCA= X-Gm-Gg: Acq92OG9JSeP5WFOPMCn7R6SFPsi2nuiQCTey2M6SgVB1o91ri4pGJN+l3s6o9qBsG/ xXTeMhKoNH+sxrTQcMEPhDdwsJPsCEW7knOnBHS46BeV7mrRu4+KKQRJgSIOj34pueiLG5fJs7V QZXI+oRF7v5ttfHOkwmzO1laHs0tVRJrpZYm3H7VqUOrJXfeiqQquJZT6Jvm/RHU2vjzkyxy7xN tc3d9+uQh4AewUFmC4cw8PFQy3rLkR01t7JfRrqx3f611BFmJj2NvbazAKb6725IrSolHDS+6af P3yeYeVFIpc7+CLOf5SNBSNxIzIu7Gu0KG0etRfJYVu4ByCGP/NCwCaSodJGl/aWMKE0HVINinm uwoyxncAEYJy8oPzh6a/lDTWiZcVf0lR/8R5pelok X-Received: by 2002:a05:7022:f416:b0:132:1e00:f6e8 with SMTP id a92af1059eb24-1398fb51cbemr965318c88.14.1781691799201; Wed, 17 Jun 2026 03:23:19 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Etsuro Fujita Date: Wed, 17 Jun 2026 19:23:07 +0900 X-Gm-Features: AVVi8Cci2tG7gg4koAf-VVYu990wM3MI6FlwO2FlJSO4Q64YiXTLmzUShcf67n0 Message-ID: Subject: Re: use of SPI by postgresImportForeignStatistics To: Corey Huinker Cc: Robert Haas , "pgsql-hackers@postgresql.org" 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 Hi Corey, On Wed, Jun 17, 2026 at 7:50=E2=80=AFAM Corey Huinker wrote: > I think the right first step is to create the functions import_relation_s= tats() and import_attribute_stats() which take the oid of the destination r= elation and the rest of the parameters are const char pointers, which is th= e ideal case for a bunch of values being fetched from PQgetValue(). Those f= unctions will for now just make the call to attribute_statistics_update() /= relation_statistics_update(), but at least it will be localized inside rel= ation_stats.c and attribute_stats.c where we can make internal refactors wi= thout disturbing anyone else. +1 > Now, we *could* make these 2 new functions take the oid/oid+attname follo= wed by a variadic array of keyname+value string pairs like the existing pg_= restore_*_stats() functions, so the functions call signature would be somew= hat future-proofed. Let me know if that violates your vision of what this s= hould be. IMO I don't think we need to go that far, because 1) the new functions are provided for FDW authors only, and 2) we don't make changes to the stats that often. Thanks! Best regards, Etsuro Fujita