mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Add sql_features table to information schema. Generate the features list
in the documentation from that same data.
This commit is contained in:
54
doc/src/sgml/mk_feature_tables.pl
Normal file
54
doc/src/sgml/mk_feature_tables.pl
Normal file
@ -0,0 +1,54 @@
|
||||
# /usr/bin/perl -w
|
||||
|
||||
my $yesno = $ARGV[0];
|
||||
|
||||
open PACK, $ARGV[1] or die;
|
||||
|
||||
my %feature_packages;
|
||||
|
||||
while (<PACK>) {
|
||||
chomp;
|
||||
my ($fid, $pname) = split /\t/;
|
||||
if ($feature_packages{$fid}) {
|
||||
$feature_packages{$fid} .= ", $pname";
|
||||
} else {
|
||||
$feature_packages{$fid} = $pname;
|
||||
}
|
||||
}
|
||||
|
||||
close PACK;
|
||||
|
||||
open FEAT, $ARGV[2] or die;
|
||||
|
||||
print "<tbody>\n";
|
||||
|
||||
while (<FEAT>) {
|
||||
chomp;
|
||||
my ($feature_id, $feature_name, $subfeature_id, $subfeature_name, $is_supported, $comments) = split /\t/;
|
||||
|
||||
$is_supported eq $yesno || next;
|
||||
|
||||
$subfeature_name =~ s/</</g;
|
||||
$subfeature_name =~ s/>/>/g;
|
||||
|
||||
print " <row>\n";
|
||||
|
||||
if ($subfeature_id) {
|
||||
print " <entry>$feature_id-$subfeature_id</entry>\n";
|
||||
} else {
|
||||
print " <entry>$feature_id</entry>\n";
|
||||
}
|
||||
print " <entry>" . $feature_packages{$feature_id} . "</entry>\n";
|
||||
if ($subfeature_id) {
|
||||
print " <entry>$subfeature_name</entry>\n";
|
||||
} else {
|
||||
print " <entry>$feature_name</entry>\n";
|
||||
}
|
||||
print " <entry>$comments</entry>\n";
|
||||
|
||||
print " </row>\n";
|
||||
}
|
||||
|
||||
print "</tbody>\n";
|
||||
|
||||
close FEAT;
|
Reference in New Issue
Block a user