diff --git a/src/backend/utils/Gen_fmgrtab.sh.in b/src/backend/utils/Gen_fmgrtab.sh.in index 7b8dd1a9b9..bc6edf9019 100644 --- a/src/backend/utils/Gen_fmgrtab.sh.in +++ b/src/backend/utils/Gen_fmgrtab.sh.in @@ -9,7 +9,7 @@ # # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/backend/utils/Attic/Gen_fmgrtab.sh.in,v 1.23 2000/05/29 20:18:30 tgl Exp $ +# $Header: /cvsroot/pgsql/src/backend/utils/Attic/Gen_fmgrtab.sh.in,v 1.24 2000/06/02 02:00:28 tgl Exp $ # # NOTES # Passes any -D options on to cpp prior to generating the list @@ -82,7 +82,7 @@ cat > $OIDSFILE < $OIDSFILE < $TABLEFILE <> $TABLEFILE <> $TABLEFILE +# Note: using awk arrays to translate from pg_proc values to fmgrtab values +# may seem tedious, but avoid the temptation to write a quick x?y:z +# conditional expression instead. Not all awks have conditional expressions. + +awk 'BEGIN { + Strict["t"] = "true" + Strict["f"] = "false" + OldStyle["11"] = "true" + OldStyle["12"] = "false" +} +{ printf (" { %d, \"%s\", %d, %s, %s, %s },\n"), \ + $1, $(NF-1), $9, Strict[$8], OldStyle[$4], $(NF-1) +}' $RAWFILE >> $TABLEFILE cat >> $TABLEFILE <