9
9
#
10
10
#
11
11
# IDENTIFICATION
12
- # $Header: /cvsroot/pgsql/src/backend/utils/Attic/Gen_fmgrtab.sh.in,v 1.23 2000/05/29 20:18:30 tgl Exp $
12
+ # $Header: /cvsroot/pgsql/src/backend/utils/Attic/Gen_fmgrtab.sh.in,v 1.24 2000/06/02 02:00:28 tgl Exp $
13
13
#
14
14
# NOTES
15
15
# Passes any -D options on to cpp prior to generating the list
@@ -82,7 +82,7 @@ cat > $OIDSFILE <<FuNkYfMgRsTuFf
82
82
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
83
83
* Portions Copyright (c) 1994, Regents of the University of California
84
84
*
85
- * $Id : Gen_fmgrtab.sh.in,v 1.23 2000/05/29 20:18:30 tgl Exp $
85
+ * $Id : Gen_fmgrtab.sh.in,v 1.24 2000/06/02 02:00:28 tgl Exp $
86
86
*
87
87
* NOTES
88
88
* ******************************
@@ -105,8 +105,8 @@ cat > $OIDSFILE <<FuNkYfMgRsTuFf
105
105
* For example, we want to be able to assign different macro names to both
106
106
* char_text() and int4_text() even though these both appear with proname
107
107
* 'text'. If the same C function appears in more than one pg_proc entry,
108
- * its equivalent macro will be defined with the OID of the entry appearing
109
- * first in pg_proc.h .
108
+ * its equivalent macro will be defined with the lowest OID among those
109
+ * entries .
110
110
*/
111
111
FuNkYfMgRsTuFf
112
112
@@ -139,7 +139,7 @@ cat > $TABLEFILE <<FuNkYfMgRtAbStUfF
139
139
* Portions Copyright (c) 1994, Regents of the University of California
140
140
*
141
141
* IDENTIFICATION
142
- * $Header : /cvsroot/pgsql/src/backend/utils/Attic/Gen_fmgrtab.sh.in,v 1.23 2000/05/29 20:18:30 tgl Exp $
142
+ * $Header : /cvsroot/pgsql/src/backend/utils/Attic/Gen_fmgrtab.sh.in,v 1.24 2000/06/02 02:00:28 tgl Exp $
143
143
*
144
144
* NOTES
145
145
*
@@ -170,11 +170,19 @@ cat >> $TABLEFILE <<FuNkYfMgRtAbStUfF
170
170
const FmgrBuiltin fmgr_builtins[] = {
171
171
FuNkYfMgRtAbStUfF
172
172
173
- awk ' { printf (" { %d, \"%s\", %d, %s, %s, %s },\n"), \
174
- $1, $(NF-1), $9, \
175
- ($8 == "t") ? "true" : "false", \
176
- ($4 == "11") ? "true" : "false", \
177
- $(NF-1) }' $RAWFILE >> $TABLEFILE
173
+ # Note: using awk arrays to translate from pg_proc values to fmgrtab values
174
+ # may seem tedious, but avoid the temptation to write a quick x?y:z
175
+ # conditional expression instead. Not all awks have conditional expressions.
176
+
177
+ awk ' BEGIN {
178
+ Strict["t"] = "true"
179
+ Strict["f"] = "false"
180
+ OldStyle["11"] = "true"
181
+ OldStyle["12"] = "false"
182
+ }
183
+ { printf (" { %d, \"%s\", %d, %s, %s, %s },\n"), \
184
+ $1, $(NF-1), $9, Strict[$8], OldStyle[$4], $(NF-1)
185
+ }' $RAWFILE >> $TABLEFILE
178
186
179
187
cat >> $TABLEFILE << FuNkYfMgRtAbStUfF
180
188
/* dummy entry is easier than getting rid of comma after last real one */
0 commit comments