3 # Generate the errcodes-table.sgml file from errcodes.txt
4 # Copyright (c) 2000-2025, PostgreSQL Global Development Group
7 use warnings FATAL
=> 'all';
10 "<!-- autogenerated from src/backend/utils/errcodes.txt, do not edit -->\n";
12 open my $errcodes, '<', $ARGV[0] or die;
22 # Emit section headers
26 # Remove the Section: string
29 # Escape dashes for SGML
32 # Wrap PostgreSQL in <productname/>
33 s/PostgreSQL/<productname>PostgreSQL<\/productname
>/g
;
37 print "<entry spanname=\"span12\">";
38 print "<emphasis role=\"bold\">$_</emphasis></entry>\n";
44 die unless /^([^\s]{5})\s+([EWS])\s+([^\s]+)(?:\s+)?([^\s]+)?/;
46 (my $sqlstate, my $type, my $errcode_macro, my $condition_name) =
49 # Skip lines without PL/pgSQL condition names
50 next unless defined($condition_name);
54 print "<entry><literal>$sqlstate</literal></entry>\n";
55 print "<entry><symbol>$condition_name</symbol></entry>\n";