Re: Generate GUC tables from .dat file
От | John Naylor |
---|---|
Тема | Re: Generate GUC tables from .dat file |
Дата | |
Msg-id | CANWCAZaP-B0sfMo6546Bhm13OjuOeLZ1=H8Q0+d-6AKYqyczvA@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Generate GUC tables from .dat file (Peter Eisentraut <peter@eisentraut.org>) |
Список | pgsql-hackers |
On Mon, Aug 25, 2025 at 4:36 PM Peter Eisentraut <peter@eisentraut.org> wrote: > > Here is an updated patch with the remaining comments carried over. I'm > not sure how I lost these. I also added some more comments to the Perl > script and have it print the usual boilerplate into the header. And I > added some .gitignore entries. This seems pretty complete to me now. Looks good overall. Some style suggestions: + print $ofh qq[\t\t] + . ($entry->{check_hook} || 'NULL') . qq[, ] + . ($entry->{assign_hook} || 'NULL') . qq[, ] + . ($entry->{show_hook} || 'NULL') . qq[\n]; The string construction in this script is rather verbose. I'd do something like: printf $ofh "\t\t%s, %s, %s\n", $entry->{check_hook} || 'NULL', $entry->{assign_hook} || 'NULL', $entry->{show_hook} || 'NULL'; + print $ofh "#ifdef " . $entry->{ifdef} . "\n" if $entry->{ifdef}; Likewise: print $ofh "#ifdef $entry->{ifdef}\n" if $entry->{ifdef}; + print $ofh qq[\t\t\tgettext_noop("] + . escape($entry->{long_desc}) . qq[")]; If the "escape" function was a "quote" function that also did its own escaping, there'd be less need for these literal quotes, and so maybe no need for the "qq[]"'s here. + boot_val => '""', + boot_val => '"ISO, MDY"', A "quote" function could also insert these for config_string GUCs. -- John Naylor Amazon Web Services
В списке pgsql-hackers по дате отправления: