Re: Improve readability by using designated initializers when possible
Jelte Fennema-Nio <postgres@jeltef.nl>
From: Jelte Fennema-Nio <postgres@jeltef.nl>
To: Jeff Davis <pgsql@j-davis.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>,
Michael Paquier <michael@paquier.xyz>, Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: 2024-02-23T09:59:53Z
Lists: pgsql-hackers
Attachments
- v2-0001-Remove-unnecessary-object_classes-array.patch (application/octet-stream) patch v2-0001
- v2-0002-Use-designated-initializer-syntax-to-improve-read.patch (application/octet-stream) patch v2-0002
On Fri, 23 Feb 2024 at 02:57, Jeff Davis <pgsql@j-davis.com> wrote: > 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. I did a bit of git spelunking and the reason seems to be that back in 2002 when this was introduced not all relation ids were compile time constants and thus an array was initialized once at bootup. I totally agree with you that these days there's no reason for the array. So I now added a second patch that removes this array, instead of updating it to use the designated initializer syntax.
Commits
-
Remove ObjectClass type
- 89e5ef7e2181 17.0 landed
-
Simplify pg_enc2gettext_tbl[] with C99-designated initializer syntax
- 655dc310460c 17.0 landed
-
Use C99-designated initializer syntax for arrays related to encodings
- ada87a4d95fc 17.0 landed
-
Remove last NULL element in config_group_names[]
- 48920476b490 17.0 landed
-
Use C99-designated initializer syntax for more arrays
- afd8ef39094b 17.0 landed
-
Remove unnecessary array object_classes[] in dependency.c
- ef5e2e90859a 17.0 landed
-
Add trailing commas to enum definitions
- 611806cd726f 17.0 cited