3
# Generate the errcodes-table.sgml file from errcodes.txt
4
# Copyright (c) 2000-2011, PostgreSQL Global Development Group
9
print "<!-- autogenerated from src/backend/utils/errcodes.txt, do not edit -->\n";
11
open my $errcodes, $ARGV[0] or die;
20
# Emit section headers
23
# Remove the Section: string
25
# Escape dashes for SGML
27
# Wrap PostgreSQL in <productname/>
28
s/PostgreSQL/<productname>PostgreSQL<\/>/g;
32
print "<entry spanname=\"span13\">";
33
print "<emphasis role=\"bold\">$_</></entry>\n";
39
die unless /^([^\s]{5})\s+([EWS])\s+([^\s]+)(?:\s+)?([^\s]+)?/;
44
my $condition_name) = ($1, $2, $3, $4);
46
# Skip lines without PL/pgSQL condition names
47
next unless defined($condition_name);
49
my $meaning = $condition_name;
53
$meaning =~ tr/[a-z]/[A-Z]/;
57
print "<entry><literal>$sqlstate</literal></entry>\n";
58
print "<entry>$meaning</entry>\n";
59
print "<entry>$condition_name</entry>\n";