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 1vMZop-00DjFe-1t for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Nov 2025 22:41:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vMZoo-009u4o-0V for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Nov 2025 22:41:30 +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.96) (envelope-from ) id 1vMZon-009u4f-2Z for pgsql-hackers@lists.postgresql.org; Fri, 21 Nov 2025 22:41:30 +0000 Received: from mail-il1-x12a.google.com ([2607:f8b0:4864:20::12a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vMZol-000ldW-2W for pgsql-hackers@lists.postgresql.org; Fri, 21 Nov 2025 22:41:29 +0000 Received: by mail-il1-x12a.google.com with SMTP id e9e14a558f8ab-433261f2045so10445485ab.3 for ; Fri, 21 Nov 2025 14:41:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763764888; x=1764369688; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=JVPfFzmHw9NbdIbipLokK15XitSzH/j5X2t9d6JOBh0=; b=axOskRnlNcpZY657eBHFStY+xokqjcvMebSYWSN2htLD/siM5q8wkedFBXQamA8S2S PG3uYmvlc/rFRJRlBwZvbRpRVe3LW7WsJkchkuyUoYMMoxggfHxaw2daauMCDA69oczo jUkGJ7dS+fKESHSZcH7gQPwV2dulXdOaYP59LPaL1r0VuWizjB3rJS84YdTjTpT2vabv RL1CSOtsG/lOTqpUU8P+YskTnM7oWIA+FFZp9Sn6lQIdIh8nnH8Mn0R5X9qG7eujrwJ0 dhzZMKKFS3PqpWCF/gzNPvx0ss6nlqGZgths/ZY1QWk24Rve+FB80VCV/iza8UhJP4iR UNfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763764888; x=1764369688; h=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=JVPfFzmHw9NbdIbipLokK15XitSzH/j5X2t9d6JOBh0=; b=RRNgs8XLTLLLOtavILc+UgSClJOGUDzd5aTQ+RC3K6qdUc/snlqJo8vgVUOeLuLDGS EymJi4iCEH+D3V8LrvYcmQCwvwOb1keCb7JllOeZqECnWwQYlu9mNwQQDbSv/XToX6sA 9mDBWuiSA2yWk62JVGKLXHP1kxucs/DlV1F7/Wvrr77pZRXzoNMGeQv/NNIxAUoBGrlw sXUkJnJnLfelib2LWCIw/iNJmR8TDIRcFnAk0Hrh+Ru1lw4xuqhXrs25GcJNEAzbJ2E5 bDrEfesTuDXfKKWejx/FM+gtfUiu/kFxhLdJycTV4TMblCLYbtMvlypE6ZwTnapvLNtd O9rA== X-Forwarded-Encrypted: i=1; AJvYcCXppaWQX4gMIngpey6wTR+cbszAJjmyWZQRpkQmdNN/zNHnI1e0Dig2v+RATXuUF2b76cxEG6ccyL1lVJID@lists.postgresql.org X-Gm-Message-State: AOJu0YzMEnD8PJBvsERIKmMm12atggdSoeqevkaqtMf9dMRvipP3AyEd 7eM/GHHK7PnkaZL+yDvoEbpPYT1SVqEHuN8XIKkooj1luky8uVO8ZYQBqA4QCaa67Xi7V6qwG/C BXUOUMcAHzYqUOlVXFqo+kGf4OyHaLNM= X-Gm-Gg: ASbGnctlDHOn1O22y1pZ1W5blYhZ9pN77ZAByGdlmpJOyVgnpYEqQa9gw2nOv1brn3j Is8+FLaanyN5OYoe8NQ72Wdyrbw6OzqgpxyIooXixGmMiqn4liSeN66p4NwJNeIyGybPcipo4oJ P+dROhWoXLU2MNWAS0YPKEUmyu7s7EiJgP64hT79TqGTJ82cLs+0IW86dDuJBJyXUeEji7CUiw2 pQRzOTMwtkx4KHmSfaSOvevdhE+cVGbtQwlrsl1muz64aNP+/0SkjhjCW/uwXuCbFU/nc7ljHPy otp+8rGN04siHxkDWVBi0xAQOqs= X-Google-Smtp-Source: AGHT+IEjEpRzckSHra7cKsQMJOJ2jI83l9cF+ytl7DTZt4sIUUs7C5gvBkzSSv9hVN0UcYmZyYvvmXTsOnm8o68HiA0= X-Received: by 2002:a05:6e02:23c3:b0:434:767d:8a4a with SMTP id e9e14a558f8ab-435b8c43cecmr34394835ab.18.1763764887895; Fri, 21 Nov 2025 14:41:27 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Corey Huinker Date: Fri, 21 Nov 2025 17:41:15 -0500 X-Gm-Features: AWmQ_bn8qT3uiRqorZtd2IfQITxKugOV7i1pdzH0_E36j0gMRhHIvkRYpX0pCE8 Message-ID: Subject: Re: Extended Statistics set/restore/clear functions. To: Yuefei Shi Cc: jian he , Michael Paquier , Tomas Vondra , pgsql-hackers@lists.postgresql.org, tgl@sss.pgh.pa.us Content-Type: multipart/alternative; boundary="0000000000009c446e0644228393" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000009c446e0644228393 Content-Type: text/plain; charset="UTF-8" > > > A few small comments. > > 1. Minor typo fixes: > +1 Thanks. > 2.Code maintainability suggestion: > I noticed the string "malformed pg_dependencies: "%s"" is used repeatedly > throughout the code. Would you consider defining this as a macro? This > could reduce duplication and make future updates easier. > It seems to be the way of things. As I stated earlier, what I'd really like is the ability to form different errdetails and have them feed into one errsave(), and still have the strings go through translation. > > 3.Memory management observation: > Regarding item_attnum_list, while PostgreSQL's memory context mechanism > handles cleanup, explicitly freeing the allocated memory after use might > improve code clarity. > > These are all minor points - the implementation looks solid overall. Thank > you for your work on this feature! > +1 --0000000000009c446e0644228393 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

A few small comments.

1.=C2=A0M= inor typo fixes:

+1 Thank= s.
=C2=A0
=
2.Code maintainability sug= gestion:
I noticed the string "malformed pg_dependencies: &q= uot;%s"" is used repeatedly throughout the code. Would you consid= er defining this as a macro? This could reduce duplication and make future = updates easier.

It seems = to be the way of things. As I stated earlier, what I'd really like is t= he ability to form different errdetails=C2=A0and have them feed into one er= rsave(), and still have the=C2=A0strings go through translation.
=
=C2=A0

3.Memory manag= ement observation:
Regarding item_attnum_li= st, while PostgreSQL's memory context mechanism handles cleanup, explic= itly freeing the allocated memory after use might improve code clarity.

These are all minor points - the implement= ation looks solid overall. Thank you for your work on this feature!

+1=C2=A0
--0000000000009c446e0644228393--