Re: Improve readability by using designated initializers when possible

From: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Japin Li <japinli(at)hotmail(dot)com>, jian he <jian(dot)universality(at)gmail(dot)com>, Jeff Davis <pgsql(at)j-davis(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Improve readability by using designated initializers when possible
Date: 2024-02-29 03:01:47
Message-ID: CAGECzQRYeEFvGQaPnv7mO36RY7W_Zw7oXCO-Ey=7SvfxRot1dQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 29 Feb 2024 at 01:57, Michael Paquier <michael(at)paquier(dot)xyz> wrote:
> I have doubts about the changes in raw_pg_bind_textdomain_codeset(),
> as the encoding could come from the value in the pg_database tuples
> themselves. The current coding is slightly safer from the perspective
> of bogus input values as we would loop over pg_enc2gettext_tbl looking
> for a match. 0003 changes that so as we could point to incorrect
> memory areas rather than fail safely for the NULL check.

That's fair. Attached is a patch that adds a PG_VALID_ENCODING check
to raw_pg_bind_textdomain_codeset to solve this regression.

Attachment Content-Type Size
v7-0003-Simplify-pg_enc2gettext_tbl.patch text/x-patch 5.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2024-02-29 03:04:35 Re: bug report: some issues about pg_15_stable(8fa4a1ac61189efffb8b851ee77e1bc87360c445)
Previous Message Peter Smith 2024-02-29 02:59:19 Re: Synchronizing slots from primary to standby