Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfce7c73

Browse files
committed
Sort guc_parameters.dat alphabetically by name
The order in this list was previously pretty random and had grownorganically over time. This made it unnecessarily cumbersome tomaintain these lists, as there was no clear guidelines about where toput new entries. Also, after the merger of the type-specific GUCstructs, the list still reflected the previous type-specificsuper-order.By using alphabetical order, the place for new entries becomes clear,and often related entries will be listed close together.This patch reorders the existing entries in guc_parameters.dat, and italso augments the generation script to error if an entry is found atthe wrong place.Note: The order is actually checked after lower-casing, to handle thelikes of "DateStyle".Reviewed-by: John Naylor <johncnaylorls@gmail.com>Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de>Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>Discussion:https://www.postgresql.org/message-id/flat/8fdfb91e-60fb-44fa-8df6-f5dea47353c9@eisentraut.org
1 parent8f29467 commitfce7c73

File tree

2 files changed

+2469
-2459
lines changed

2 files changed

+2469
-2459
lines changed

‎src/backend/utils/misc/gen_guc_tables.pl‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,21 @@ sub dquote
4242
subprint_table
4343
{
4444
my ($ofh) =@_;
45+
my$prev_name =undef;
4546

4647
print$ofh"\n\n";
4748
print$ofh"struct config_generic ConfigureNames[] =\n";
4849
print$ofh"{\n";
4950

5051
foreachmy$entry (@{$parse})
5152
{
53+
if (defined($prev_name) &&lc($prev_name)gelc($entry->{name}))
54+
{
55+
diesprintf(
56+
"entries are not in alphabetical order:\"%s\",\"%s\"\n",
57+
$prev_name,$entry->{name});
58+
}
59+
5260
print$ofh"#ifdef$entry->{ifdef}\n"if$entry->{ifdef};
5361
print$ofh"\t{\n";
5462
printf$ofh"\t\t.name =%s,\n", dquote($entry->{name});
@@ -80,6 +88,8 @@ sub print_table
8088
print$ofh"\t},\n";
8189
print$ofh"#endif\n"if$entry->{ifdef};
8290
print$ofh"\n";
91+
92+
$prev_name =$entry->{name};
8393
}
8494

8595
print$ofh"\t/* End-of-list marker */\n";

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp