Re: Improve readability by using designated initializers when possible

Jeff Davis <pgsql@j-davis.com>

From: Jeff Davis <pgsql@j-davis.com>
To: Jelte Fennema-Nio <postgres@jeltef.nl>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>, Michael Paquier <michael@paquier.xyz>, Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: 2024-02-23T01:57:14Z
Lists: pgsql-hackers
On Fri, 2024-02-23 at 01:35 +0100, Jelte Fennema-Nio wrote:
> On Thu, Feb 22, 2024, 23:46 Jeff Davis <pgsql@j-davis.com> wrote:
> > 
> > Am I missing something?
> 
> The main benefits it has are:

Sorry, I was unclear. I was asking a question about the reason the
ObjectClass and the object_classes[] array exist in the current code,
it wasn't a direct question about your patch.

ObjectClass is only used in a couple places, and I don't immediately
see why those places can't just use the OID of the class (like 
OperatorClassRelationId).

Regards,
	Jeff Davis




Commits

  1. Remove ObjectClass type

  2. Simplify pg_enc2gettext_tbl[] with C99-designated initializer syntax

  3. Use C99-designated initializer syntax for arrays related to encodings

  4. Remove last NULL element in config_group_names[]

  5. Use C99-designated initializer syntax for more arrays

  6. Remove unnecessary array object_classes[] in dependency.c

  7. Add trailing commas to enum definitions