OSDN Git Service

Make backend header files C++ safe
authorPeter Eisentraut <peter_e@gmx.net>
Thu, 16 Jul 2009 06:33:46 +0000 (06:33 +0000)
committerPeter Eisentraut <peter_e@gmx.net>
Thu, 16 Jul 2009 06:33:46 +0000 (06:33 +0000)
This alters various incidental uses of C++ key words to use other similar
identifiers, so that a C++ compiler won't choke outright.  You still
(probably) need extern "C" { }; around the inclusion of backend headers.

based on a patch by Kurt Harriman <harriman@acm.org>

Also add a script cpluspluscheck to check for C++ compatibility in the
future.  As of right now, this passes without error for me.

52 files changed:
src/backend/access/common/tupdesc.c
src/backend/catalog/pg_constraint.c
src/backend/commands/indexcmds.c
src/backend/commands/sequence.c
src/backend/commands/tablecmds.c
src/backend/commands/typecmds.c
src/backend/commands/view.c
src/backend/nodes/copyfuncs.c
src/backend/nodes/equalfuncs.c
src/backend/nodes/makefuncs.c
src/backend/nodes/nodeFuncs.c
src/backend/nodes/outfuncs.c
src/backend/nodes/readfuncs.c
src/backend/optimizer/plan/subselect.c
src/backend/optimizer/util/plancat.c
src/backend/parser/gram.y
src/backend/parser/parse_clause.c
src/backend/parser/parse_expr.c
src/backend/parser/parse_relation.c
src/backend/parser/parse_target.c
src/backend/parser/parse_type.c
src/backend/parser/parse_utilcmd.c
src/backend/tcop/utility.c
src/backend/tsearch/dict_thesaurus.c
src/backend/tsearch/ts_parse.c
src/backend/tsearch/ts_selfuncs.c
src/backend/tsearch/wparser_def.c
src/backend/utils/adt/ruleutils.c
src/backend/utils/adt/tsginidx.c
src/backend/utils/adt/tsquery.c
src/backend/utils/adt/tsquery_cleanup.c
src/backend/utils/adt/tsquery_op.c
src/backend/utils/adt/tsquery_rewrite.c
src/backend/utils/adt/tsquery_util.c
src/backend/utils/adt/tsrank.c
src/backend/utils/adt/tsvector_op.c
src/backend/utils/misc/guc.c
src/backend/utils/mmgr/mcxt.c
src/include/catalog/pg_constraint.h
src/include/commands/defrem.h
src/include/commands/tablecmds.h
src/include/nodes/makefuncs.h
src/include/nodes/memnodes.h
src/include/nodes/parsenodes.h
src/include/nodes/primnodes.h
src/include/optimizer/plancat.h
src/include/parser/parse_type.h
src/include/tsearch/ts_public.h
src/include/tsearch/ts_type.h
src/include/tsearch/ts_utils.h
src/include/utils/builtins.h
src/tools/pginclude/cpluspluscheck [new file with mode: 0644]

index 79efec0..0bd5031 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/access/common/tupdesc.c,v 1.126 2009/06/11 14:48:53 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/access/common/tupdesc.c,v 1.127 2009/07/16 06:33:42 petere Exp $
  *
  * NOTES
  *       some of the executor utility code such as "ExecTypeFromTL" should be
@@ -538,10 +538,10 @@ BuildDescForRelation(List *schema)
                attnum++;
 
                attname = entry->colname;
-               atttypid = typenameTypeId(NULL, entry->typename, &atttypmod);
-               attdim = list_length(entry->typename->arrayBounds);
+               atttypid = typenameTypeId(NULL, entry->typeName, &atttypmod);
+               attdim = list_length(entry->typeName->arrayBounds);
 
-               if (entry->typename->setof)
+               if (entry->typeName->setof)
                        ereport(ERROR,
                                        (errcode(ERRCODE_INVALID_TABLE_DEFINITION),
                                         errmsg("column \"%s\" cannot be declared SETOF",
index 9e13872..e6756b7 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/catalog/pg_constraint.c,v 1.45 2009/06/11 14:48:55 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/catalog/pg_constraint.c,v 1.46 2009/07/16 06:33:42 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -419,7 +419,7 @@ ConstraintNameIsUsed(ConstraintCategory conCat, Oid objId,
  */
 char *
 ChooseConstraintName(const char *name1, const char *name2,
-                                        const char *label, Oid namespace,
+                                        const char *label, Oid namespaceid,
                                         List *others)
 {
        int                     pass = 0;
@@ -461,7 +461,7 @@ ChooseConstraintName(const char *name1, const char *name2,
                        ScanKeyInit(&skey[1],
                                                Anum_pg_constraint_connamespace,
                                                BTEqualStrategyNumber, F_OIDEQ,
-                                               ObjectIdGetDatum(namespace));
+                                               ObjectIdGetDatum(namespaceid));
 
                        conscan = systable_beginscan(conDesc, ConstraintNameNspIndexId, true,
                                                                                 SnapshotNow, 2, skey);
index c6a01f5..ef879a3 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/commands/indexcmds.c,v 1.185 2009/06/11 14:48:55 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/commands/indexcmds.c,v 1.186 2009/07/16 06:33:42 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -1237,7 +1237,7 @@ makeObjectName(const char *name1, const char *name2, const char *label)
  */
 char *
 ChooseRelationName(const char *name1, const char *name2,
-                                  const char *label, Oid namespace)
+                                  const char *label, Oid namespaceid)
 {
        int                     pass = 0;
        char       *relname = NULL;
@@ -1250,7 +1250,7 @@ ChooseRelationName(const char *name1, const char *name2,
        {
                relname = makeObjectName(name1, name2, modlabel);
 
-               if (!OidIsValid(get_relname_relid(relname, namespace)))
+               if (!OidIsValid(get_relname_relid(relname, namespaceid)))
                        break;
 
                /* found a conflict, so try a new name component */
index e6c75ab..3f535ae 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/commands/sequence.c,v 1.160 2009/06/11 14:48:56 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/commands/sequence.c,v 1.161 2009/07/16 06:33:42 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -141,53 +141,53 @@ DefineSequence(CreateSeqStmt *seq)
                switch (i)
                {
                        case SEQ_COL_NAME:
-                               coldef->typename = makeTypeNameFromOid(NAMEOID, -1);
+                               coldef->typeName = makeTypeNameFromOid(NAMEOID, -1);
                                coldef->colname = "sequence_name";
                                namestrcpy(&name, seq->sequence->relname);
                                value[i - 1] = NameGetDatum(&name);
                                break;
                        case SEQ_COL_LASTVAL:
-                               coldef->typename = makeTypeNameFromOid(INT8OID, -1);
+                               coldef->typeName = makeTypeNameFromOid(INT8OID, -1);
                                coldef->colname = "last_value";
                                value[i - 1] = Int64GetDatumFast(new.last_value);
                                break;
                        case SEQ_COL_STARTVAL:
-                               coldef->typename = makeTypeNameFromOid(INT8OID, -1);
+                               coldef->typeName = makeTypeNameFromOid(INT8OID, -1);
                                coldef->colname = "start_value";
                                value[i - 1] = Int64GetDatumFast(new.start_value);
                                break;
                        case SEQ_COL_INCBY:
-                               coldef->typename = makeTypeNameFromOid(INT8OID, -1);
+                               coldef->typeName = makeTypeNameFromOid(INT8OID, -1);
                                coldef->colname = "increment_by";
                                value[i - 1] = Int64GetDatumFast(new.increment_by);
                                break;
                        case SEQ_COL_MAXVALUE:
-                               coldef->typename = makeTypeNameFromOid(INT8OID, -1);
+                               coldef->typeName = makeTypeNameFromOid(INT8OID, -1);
                                coldef->colname = "max_value";
                                value[i - 1] = Int64GetDatumFast(new.max_value);
                                break;
                        case SEQ_COL_MINVALUE:
-                               coldef->typename = makeTypeNameFromOid(INT8OID, -1);
+                               coldef->typeName = makeTypeNameFromOid(INT8OID, -1);
                                coldef->colname = "min_value";
                                value[i - 1] = Int64GetDatumFast(new.min_value);
                                break;
                        case SEQ_COL_CACHE:
-                               coldef->typename = makeTypeNameFromOid(INT8OID, -1);
+                               coldef->typeName = makeTypeNameFromOid(INT8OID, -1);
                                coldef->colname = "cache_value";
                                value[i - 1] = Int64GetDatumFast(new.cache_value);
                                break;
                        case SEQ_COL_LOG:
-                               coldef->typename = makeTypeNameFromOid(INT8OID, -1);
+                               coldef->typeName = makeTypeNameFromOid(INT8OID, -1);
                                coldef->colname = "log_cnt";
                                value[i - 1] = Int64GetDatum((int64) 1);
                                break;
                        case SEQ_COL_CYCLE:
-                               coldef->typename = makeTypeNameFromOid(BOOLOID, -1);
+                               coldef->typeName = makeTypeNameFromOid(BOOLOID, -1);
                                coldef->colname = "is_cycled";
                                value[i - 1] = BoolGetDatum(new.is_cycled);
                                break;
                        case SEQ_COL_CALLED:
-                               coldef->typename = makeTypeNameFromOid(BOOLOID, -1);
+                               coldef->typeName = makeTypeNameFromOid(BOOLOID, -1);
                                coldef->colname = "is_called";
                                value[i - 1] = BoolGetDatum(false);
                                break;
index 846f34e..50ab811 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.289 2009/07/12 17:12:33 tgl Exp $
+ *       $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.290 2009/07/16 06:33:42 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -305,7 +305,7 @@ static void ATPrepAlterColumnType(List **wqueue,
                                          bool recurse, bool recursing,
                                          AlterTableCmd *cmd);
 static void ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
-                                         const char *colName, TypeName *typename);
+                                         const char *colName, TypeName *typeName);
 static void ATPostAlterTypeCleanup(List **wqueue, AlteredTableInfo *tab);
 static void ATPostAlterTypeParse(char *cmd, List **wqueue);
 static void change_owner_recurse_to_sequences(Oid relationOid,
@@ -1280,7 +1280,7 @@ MergeAttributes(List *schema, List *supers, bool istemp,
                                                (errmsg("merging multiple inherited definitions of column \"%s\"",
                                                                attributeName)));
                                def = (ColumnDef *) list_nth(inhSchema, exist_attno - 1);
-                               defTypeId = typenameTypeId(NULL, def->typename, &deftypmod);
+                               defTypeId = typenameTypeId(NULL, def->typeName, &deftypmod);
                                if (defTypeId != attribute->atttypid ||
                                        deftypmod != attribute->atttypmod)
                                        ereport(ERROR,
@@ -1288,7 +1288,7 @@ MergeAttributes(List *schema, List *supers, bool istemp,
                                                errmsg("inherited column \"%s\" has a type conflict",
                                                           attributeName),
                                                         errdetail("%s versus %s",
-                                                                          TypeNameToString(def->typename),
+                                                                          TypeNameToString(def->typeName),
                                                                           format_type_be(attribute->atttypid))));
                                def->inhcount++;
                                /* Merge of NOT NULL constraints = OR 'em together */
@@ -1303,7 +1303,7 @@ MergeAttributes(List *schema, List *supers, bool istemp,
                                 */
                                def = makeNode(ColumnDef);
                                def->colname = pstrdup(attributeName);
-                               def->typename = makeTypeNameFromOid(attribute->atttypid,
+                               def->typeName = makeTypeNameFromOid(attribute->atttypid,
                                                                                                        attribute->atttypmod);
                                def->inhcount = 1;
                                def->is_local = false;
@@ -1438,16 +1438,16 @@ MergeAttributes(List *schema, List *supers, bool istemp,
                                   (errmsg("merging column \"%s\" with inherited definition",
                                                   attributeName)));
                                def = (ColumnDef *) list_nth(inhSchema, exist_attno - 1);
-                               defTypeId = typenameTypeId(NULL, def->typename, &deftypmod);
-                               newTypeId = typenameTypeId(NULL, newdef->typename, &newtypmod);
+                               defTypeId = typenameTypeId(NULL, def->typeName, &deftypmod);
+                               newTypeId = typenameTypeId(NULL, newdef->typeName, &newtypmod);
                                if (defTypeId != newTypeId || deftypmod != newtypmod)
                                        ereport(ERROR,
                                                        (errcode(ERRCODE_DATATYPE_MISMATCH),
                                                         errmsg("column \"%s\" has a type conflict",
                                                                        attributeName),
                                                         errdetail("%s versus %s",
-                                                                          TypeNameToString(def->typename),
-                                                                          TypeNameToString(newdef->typename))));
+                                                                          TypeNameToString(def->typeName),
+                                                                          TypeNameToString(newdef->typeName))));
                                /* Mark the column as locally defined */
                                def->is_local = true;
                                /* Merge of NOT NULL constraints = OR 'em together */
@@ -1598,22 +1598,22 @@ change_varattnos_walker(Node *node, const AttrNumber *newattno)
  * matching according to column name.
  */
 AttrNumber *
-varattnos_map(TupleDesc old, TupleDesc new)
+varattnos_map(TupleDesc olddesc, TupleDesc newdesc)
 {
        AttrNumber *attmap;
        int                     i,
                                j;
 
-       attmap = (AttrNumber *) palloc0(sizeof(AttrNumber) * old->natts);
-       for (i = 1; i <= old->natts; i++)
+       attmap = (AttrNumber *) palloc0(sizeof(AttrNumber) * olddesc->natts);
+       for (i = 1; i <= olddesc->natts; i++)
        {
-               if (old->attrs[i - 1]->attisdropped)
+               if (olddesc->attrs[i - 1]->attisdropped)
                        continue;                       /* leave the entry as zero */
 
-               for (j = 1; j <= new->natts; j++)
+               for (j = 1; j <= newdesc->natts; j++)
                {
-                       if (strcmp(NameStr(old->attrs[i - 1]->attname),
-                                          NameStr(new->attrs[j - 1]->attname)) == 0)
+                       if (strcmp(NameStr(olddesc->attrs[i - 1]->attname),
+                                          NameStr(newdesc->attrs[j - 1]->attname)) == 0)
                        {
                                attmap[i - 1] = j;
                                break;
@@ -3530,7 +3530,7 @@ ATExecAddColumn(AlteredTableInfo *tab, Relation rel,
                        int32           ctypmod;
 
                        /* Child column must match by type */
-                       ctypeId = typenameTypeId(NULL, colDef->typename, &ctypmod);
+                       ctypeId = typenameTypeId(NULL, colDef->typeName, &ctypmod);
                        if (ctypeId != childatt->atttypid ||
                                ctypmod != childatt->atttypmod)
                                ereport(ERROR,
@@ -3597,7 +3597,7 @@ ATExecAddColumn(AlteredTableInfo *tab, Relation rel,
                                                        MaxHeapAttributeNumber)));
        }
 
-       typeTuple = typenameType(NULL, colDef->typename, &typmod);
+       typeTuple = typenameType(NULL, colDef->typeName, &typmod);
        tform = (Form_pg_type) GETSTRUCT(typeTuple);
        typeOid = HeapTupleGetOid(typeTuple);
 
@@ -3614,7 +3614,7 @@ ATExecAddColumn(AlteredTableInfo *tab, Relation rel,
        attribute.atttypmod = typmod;
        attribute.attnum = newattnum;
        attribute.attbyval = tform->typbyval;
-       attribute.attndims = list_length(colDef->typename->arrayBounds);
+       attribute.attndims = list_length(colDef->typeName->arrayBounds);
        attribute.attstorage = tform->typstorage;
        attribute.attalign = tform->typalign;
        attribute.attnotnull = colDef->is_not_null;
@@ -3788,7 +3788,7 @@ ATPrepAddOids(List **wqueue, Relation rel, bool recurse, AlterTableCmd *cmd)
                ColumnDef  *cdef = makeNode(ColumnDef);
 
                cdef->colname = pstrdup("oid");
-               cdef->typename = makeTypeNameFromOid(OIDOID, -1);
+               cdef->typeName = makeTypeNameFromOid(OIDOID, -1);
                cdef->inhcount = 0;
                cdef->is_local = true;
                cdef->is_not_null = true;
@@ -5548,7 +5548,7 @@ ATPrepAlterColumnType(List **wqueue,
                                          AlterTableCmd *cmd)
 {
        char       *colName = cmd->name;
-       TypeName   *typename = (TypeName *) cmd->def;
+       TypeName   *typeName = (TypeName *) cmd->def;
        HeapTuple       tuple;
        Form_pg_attribute attTup;
        AttrNumber      attnum;
@@ -5583,7 +5583,7 @@ ATPrepAlterColumnType(List **wqueue,
                                                colName)));
 
        /* Look up the target type */
-       targettype = typenameTypeId(NULL, typename, &targettypmod);
+       targettype = typenameTypeId(NULL, typeName, &targettypmod);
 
        /* make sure datatype is legal for a column */
        CheckAttributeType(colName, targettype);
@@ -5678,7 +5678,7 @@ ATPrepAlterColumnType(List **wqueue,
 
 static void
 ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
-                                         const char *colName, TypeName *typename)
+                                         const char *colName, TypeName *typeName)
 {
        HeapTuple       heapTup;
        Form_pg_attribute attTup;
@@ -5715,7 +5715,7 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
                                                colName)));
 
        /* Look up the target type (should not fail, since prep found it) */
-       typeTuple = typenameType(NULL, typename, &targettypmod);
+       typeTuple = typenameType(NULL, typeName, &targettypmod);
        tform = (Form_pg_type) GETSTRUCT(typeTuple);
        targettype = HeapTupleGetOid(typeTuple);
 
@@ -5962,7 +5962,7 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
         */
        attTup->atttypid = targettype;
        attTup->atttypmod = targettypmod;
-       attTup->attndims = list_length(typename->arrayBounds);
+       attTup->attndims = list_length(typeName->arrayBounds);
        attTup->attlen = tform->typlen;
        attTup->attbyval = tform->typbyval;
        attTup->attalign = tform->typalign;
index f791c53..659b591 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/commands/typecmds.c,v 1.134 2009/06/11 14:48:56 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/commands/typecmds.c,v 1.135 2009/07/16 06:33:42 petere Exp $
  *
  * DESCRIPTION
  *       The "DefineFoo" routines take the parse tree and pick out the
@@ -759,7 +759,7 @@ DefineDomain(CreateDomainStmt *stmt)
        bool            saw_default = false;
        bool            typNotNull = false;
        bool            nullDefined = false;
-       int32           typNDims = list_length(stmt->typename->arrayBounds);
+       int32           typNDims = list_length(stmt->typeName->arrayBounds);
        HeapTuple       typeTup;
        List       *schema = stmt->constraints;
        ListCell   *listptr;
@@ -799,7 +799,7 @@ DefineDomain(CreateDomainStmt *stmt)
        /*
         * Look up the base type.
         */
-       typeTup = typenameType(NULL, stmt->typename, &basetypeMod);
+       typeTup = typenameType(NULL, stmt->typeName, &basetypeMod);
        baseType = (Form_pg_type) GETSTRUCT(typeTup);
        basetypeoid = HeapTupleGetOid(typeTup);
 
@@ -815,7 +815,7 @@ DefineDomain(CreateDomainStmt *stmt)
                ereport(ERROR,
                                (errcode(ERRCODE_DATATYPE_MISMATCH),
                                 errmsg("\"%s\" is not a valid base type for a domain",
-                                               TypeNameToString(stmt->typename))));
+                                               TypeNameToString(stmt->typeName))));
 
        /* passed by value */
        byValue = baseType->typbyval;
@@ -1097,7 +1097,7 @@ DefineEnum(CreateEnumStmt *stmt)
        Relation        pg_type;
 
        /* Convert list of names to a name and namespace */
-       enumNamespace = QualifiedNameGetCreationNamespace(stmt->typename,
+       enumNamespace = QualifiedNameGetCreationNamespace(stmt->typeName,
                                                                                                          &enumName);
 
        /* Check we have creation rights in target namespace */
index b06a48b..e235e41 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/commands/view.c,v 1.116 2009/06/11 14:48:56 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/commands/view.c,v 1.117 2009/07/16 06:33:42 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -119,7 +119,7 @@ DefineVirtualRelation(const RangeVar *relation, List *tlist, bool replace)
                        ColumnDef  *def = makeNode(ColumnDef);
 
                        def->colname = pstrdup(tle->resname);
-                       def->typename = makeTypeNameFromOid(exprType((Node *) tle->expr),
+                       def->typeName = makeTypeNameFromOid(exprType((Node *) tle->expr),
                                                                                         exprTypmod((Node *) tle->expr));
                        def->inhcount = 0;
                        def->is_local = true;
index 72c9877..ca920d1 100644 (file)
@@ -15,7 +15,7 @@
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.432 2009/06/18 01:27:02 tgl Exp $
+ *       $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.433 2009/07/16 06:33:42 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -1544,7 +1544,7 @@ _copyJoinExpr(JoinExpr *from)
        COPY_SCALAR_FIELD(isNatural);
        COPY_NODE_FIELD(larg);
        COPY_NODE_FIELD(rarg);
-       COPY_NODE_FIELD(using);
+       COPY_NODE_FIELD(usingClause);
        COPY_NODE_FIELD(quals);
        COPY_NODE_FIELD(alias);
        COPY_SCALAR_FIELD(rtindex);
@@ -1973,7 +1973,7 @@ _copyTypeName(TypeName *from)
        TypeName   *newnode = makeNode(TypeName);
 
        COPY_NODE_FIELD(names);
-       COPY_SCALAR_FIELD(typeid);
+       COPY_SCALAR_FIELD(typeOid);
        COPY_SCALAR_FIELD(setof);
        COPY_SCALAR_FIELD(pct_type);
        COPY_NODE_FIELD(typmods);
@@ -2042,7 +2042,7 @@ _copyTypeCast(TypeCast *from)
        TypeCast   *newnode = makeNode(TypeCast);
 
        COPY_NODE_FIELD(arg);
-       COPY_NODE_FIELD(typename);
+       COPY_NODE_FIELD(typeName);
        COPY_LOCATION_FIELD(location);
 
        return newnode;
@@ -2068,7 +2068,7 @@ _copyColumnDef(ColumnDef *from)
        ColumnDef  *newnode = makeNode(ColumnDef);
 
        COPY_STRING_FIELD(colname);
-       COPY_NODE_FIELD(typename);
+       COPY_NODE_FIELD(typeName);
        COPY_SCALAR_FIELD(inhcount);
        COPY_SCALAR_FIELD(is_local);
        COPY_SCALAR_FIELD(is_not_null);
@@ -2127,7 +2127,7 @@ _copyXmlSerialize(XmlSerialize *from)
 
        COPY_SCALAR_FIELD(xmloption);
        COPY_NODE_FIELD(expr);
-       COPY_NODE_FIELD(typename);
+       COPY_NODE_FIELD(typeName);
        COPY_LOCATION_FIELD(location);
 
        return newnode;
@@ -2282,7 +2282,7 @@ _copyAlterDomainStmt(AlterDomainStmt *from)
        AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
 
        COPY_SCALAR_FIELD(subtype);
-       COPY_NODE_FIELD(typename);
+       COPY_NODE_FIELD(typeName);
        COPY_STRING_FIELD(name);
        COPY_NODE_FIELD(def);
        COPY_SCALAR_FIELD(behavior);
@@ -2712,7 +2712,7 @@ _copyCreateEnumStmt(CreateEnumStmt *from)
 {
        CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
 
-       COPY_NODE_FIELD(typename);
+       COPY_NODE_FIELD(typeName);
        COPY_NODE_FIELD(vals);
 
        return newnode;
@@ -2747,7 +2747,7 @@ _copyCreateDomainStmt(CreateDomainStmt *from)
        CreateDomainStmt *newnode = makeNode(CreateDomainStmt);
 
        COPY_NODE_FIELD(domainname);
-       COPY_NODE_FIELD(typename);
+       COPY_NODE_FIELD(typeName);
        COPY_NODE_FIELD(constraints);
 
        return newnode;
index 041b969..ddb92a1 100644 (file)
@@ -22,7 +22,7 @@
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.355 2009/06/18 01:27:02 tgl Exp $
+ *       $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.356 2009/07/16 06:33:42 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -704,7 +704,7 @@ _equalJoinExpr(JoinExpr *a, JoinExpr *b)
        COMPARE_SCALAR_FIELD(isNatural);
        COMPARE_NODE_FIELD(larg);
        COMPARE_NODE_FIELD(rarg);
-       COMPARE_NODE_FIELD(using);
+       COMPARE_NODE_FIELD(usingClause);
        COMPARE_NODE_FIELD(quals);
        COMPARE_NODE_FIELD(alias);
        COMPARE_SCALAR_FIELD(rtindex);
@@ -966,7 +966,7 @@ static bool
 _equalAlterDomainStmt(AlterDomainStmt *a, AlterDomainStmt *b)
 {
        COMPARE_SCALAR_FIELD(subtype);
-       COMPARE_NODE_FIELD(typename);
+       COMPARE_NODE_FIELD(typeName);
        COMPARE_STRING_FIELD(name);
        COMPARE_NODE_FIELD(def);
        COMPARE_SCALAR_FIELD(behavior);
@@ -1330,7 +1330,7 @@ _equalCompositeTypeStmt(CompositeTypeStmt *a, CompositeTypeStmt *b)
 static bool
 _equalCreateEnumStmt(CreateEnumStmt *a, CreateEnumStmt *b)
 {
-       COMPARE_NODE_FIELD(typename);
+       COMPARE_NODE_FIELD(typeName);
        COMPARE_NODE_FIELD(vals);
 
        return true;
@@ -1359,7 +1359,7 @@ static bool
 _equalCreateDomainStmt(CreateDomainStmt *a, CreateDomainStmt *b)
 {
        COMPARE_NODE_FIELD(domainname);
-       COMPARE_NODE_FIELD(typename);
+       COMPARE_NODE_FIELD(typeName);
        COMPARE_NODE_FIELD(constraints);
 
        return true;
@@ -1966,7 +1966,7 @@ static bool
 _equalTypeName(TypeName *a, TypeName *b)
 {
        COMPARE_NODE_FIELD(names);
-       COMPARE_SCALAR_FIELD(typeid);
+       COMPARE_SCALAR_FIELD(typeOid);
        COMPARE_SCALAR_FIELD(setof);
        COMPARE_SCALAR_FIELD(pct_type);
        COMPARE_NODE_FIELD(typmods);
@@ -1981,7 +1981,7 @@ static bool
 _equalTypeCast(TypeCast *a, TypeCast *b)
 {
        COMPARE_NODE_FIELD(arg);
-       COMPARE_NODE_FIELD(typename);
+       COMPARE_NODE_FIELD(typeName);
        COMPARE_LOCATION_FIELD(location);
 
        return true;
@@ -2047,7 +2047,7 @@ static bool
 _equalColumnDef(ColumnDef *a, ColumnDef *b)
 {
        COMPARE_STRING_FIELD(colname);
-       COMPARE_NODE_FIELD(typename);
+       COMPARE_NODE_FIELD(typeName);
        COMPARE_SCALAR_FIELD(inhcount);
        COMPARE_SCALAR_FIELD(is_local);
        COMPARE_SCALAR_FIELD(is_not_null);
@@ -2207,7 +2207,7 @@ _equalXmlSerialize(XmlSerialize *a, XmlSerialize *b)
 {
        COMPARE_SCALAR_FIELD(xmloption);
        COMPARE_NODE_FIELD(expr);
-       COMPARE_NODE_FIELD(typename);
+       COMPARE_NODE_FIELD(typeName);
        COMPARE_LOCATION_FIELD(location);
 
        return true;
index 4a649ee..7226d6b 100644 (file)
@@ -9,7 +9,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/nodes/makefuncs.c,v 1.64 2009/04/04 21:12:31 tgl Exp $
+ *       $PostgreSQL: pgsql/src/backend/nodes/makefuncs.c,v 1.65 2009/07/16 06:33:42 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -316,11 +316,11 @@ makeTypeNameFromNameList(List *names)
  *     build a TypeName node to represent a type already known by OID/typmod.
  */
 TypeName *
-makeTypeNameFromOid(Oid typeid, int32 typmod)
+makeTypeNameFromOid(Oid typeOid, int32 typmod)
 {
        TypeName   *n = makeNode(TypeName);
 
-       n->typeid = typeid;
+       n->typeOid = typeOid;
        n->typemod = typmod;
        n->location = -1;
        return n;
@@ -373,12 +373,12 @@ makeDefElem(char *name, Node *arg)
  *     build a DefElem node with all fields available to be specified
  */
 DefElem *
-makeDefElemExtended(char *namespace, char *name, Node *arg,
+makeDefElemExtended(char *nameSpace, char *name, Node *arg,
                                        DefElemAction defaction)
 {
        DefElem    *res = makeNode(DefElem);
 
-       res->defnamespace = namespace;
+       res->defnamespace = nameSpace;
        res->defname = name;
        res->arg = arg;
        res->defaction = defaction;
index 0d21c9f..4dc9bd4 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/nodes/nodeFuncs.c,v 1.40 2009/06/11 14:48:58 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/nodes/nodeFuncs.c,v 1.41 2009/07/16 06:33:42 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -889,7 +889,7 @@ exprLocation(Node *expr)
                                 * any of the components might be leftmost.
                                 */
                                loc = exprLocation(tc->arg);
-                               loc = leftmostLoc(loc, tc->typename->location);
+                               loc = leftmostLoc(loc, tc->typeName->location);
                                loc = leftmostLoc(loc, tc->location);
                        }
                        break;
@@ -2417,7 +2417,7 @@ bool
 
                                if (walker(tc->arg, context))
                                        return true;
-                               if (walker(tc->typename, context))
+                               if (walker(tc->typeName, context))
                                        return true;
                        }
                        break;
@@ -2468,7 +2468,7 @@ bool
                        {
                                ColumnDef  *coldef = (ColumnDef *) node;
 
-                               if (walker(coldef->typename, context))
+                               if (walker(coldef->typeName, context))
                                        return true;
                                if (walker(coldef->raw_default, context))
                                        return true;
@@ -2483,7 +2483,7 @@ bool
 
                                if (walker(xs->expr, context))
                                        return true;
-                               if (walker(xs->typename, context))
+                               if (walker(xs->typeName, context))
                                        return true;
                        }
                        break;
index d79bd75..4e808a5 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.360 2009/06/11 14:48:58 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.361 2009/07/16 06:33:42 petere Exp $
  *
  * NOTES
  *       Every node type that can appear in stored rules' parsetrees *must*
@@ -1259,7 +1259,7 @@ _outJoinExpr(StringInfo str, JoinExpr *node)
        WRITE_BOOL_FIELD(isNatural);
        WRITE_NODE_FIELD(larg);
        WRITE_NODE_FIELD(rarg);
-       WRITE_NODE_FIELD(using);
+       WRITE_NODE_FIELD(usingClause);
        WRITE_NODE_FIELD(quals);
        WRITE_NODE_FIELD(alias);
        WRITE_INT_FIELD(rtindex);
@@ -1822,7 +1822,7 @@ _outXmlSerialize(StringInfo str, XmlSerialize *node)
 
        WRITE_ENUM_FIELD(xmloption, XmlOptionType);
        WRITE_NODE_FIELD(expr);
-       WRITE_NODE_FIELD(typename);
+       WRITE_NODE_FIELD(typeName);
        WRITE_LOCATION_FIELD(location);
 }
 
@@ -1832,7 +1832,7 @@ _outColumnDef(StringInfo str, ColumnDef *node)
        WRITE_NODE_TYPE("COLUMNDEF");
 
        WRITE_STRING_FIELD(colname);
-       WRITE_NODE_FIELD(typename);
+       WRITE_NODE_FIELD(typeName);
        WRITE_INT_FIELD(inhcount);
        WRITE_BOOL_FIELD(is_local);
        WRITE_BOOL_FIELD(is_not_null);
@@ -1847,7 +1847,7 @@ _outTypeName(StringInfo str, TypeName *node)
        WRITE_NODE_TYPE("TYPENAME");
 
        WRITE_NODE_FIELD(names);
-       WRITE_OID_FIELD(typeid);
+       WRITE_OID_FIELD(typeOid);
        WRITE_BOOL_FIELD(setof);
        WRITE_BOOL_FIELD(pct_type);
        WRITE_NODE_FIELD(typmods);
@@ -1862,7 +1862,7 @@ _outTypeCast(StringInfo str, TypeCast *node)
        WRITE_NODE_TYPE("TYPECAST");
 
        WRITE_NODE_FIELD(arg);
-       WRITE_NODE_FIELD(typename);
+       WRITE_NODE_FIELD(typeName);
        WRITE_LOCATION_FIELD(location);
 }
 
index b27cd51..8f5264d 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/nodes/readfuncs.c,v 1.222 2009/06/11 14:48:58 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/nodes/readfuncs.c,v 1.223 2009/07/16 06:33:42 petere Exp $
  *
  * NOTES
  *       Path and Plan nodes do not have any readfuncs support, because we
@@ -1070,7 +1070,7 @@ _readJoinExpr(void)
        READ_BOOL_FIELD(isNatural);
        READ_NODE_FIELD(larg);
        READ_NODE_FIELD(rarg);
-       READ_NODE_FIELD(using);
+       READ_NODE_FIELD(usingClause);
        READ_NODE_FIELD(quals);
        READ_NODE_FIELD(alias);
        READ_INT_FIELD(rtindex);
index f8d11a4..e56c075 100644 (file)
@@ -7,7 +7,7 @@
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/optimizer/plan/subselect.c,v 1.151 2009/07/06 02:16:03 tgl Exp $
+ *       $PostgreSQL: pgsql/src/backend/optimizer/plan/subselect.c,v 1.152 2009/07/16 06:33:43 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -1089,7 +1089,7 @@ convert_ANY_sublink_to_join(PlannerInfo *root, SubLink *sublink,
        result->isNatural = false;
        result->larg = NULL;            /* caller must fill this in */
        result->rarg = (Node *) rtr;
-       result->using = NIL;
+       result->usingClause = NIL;
        result->quals = quals;
        result->alias = NULL;
        result->rtindex = 0;            /* we don't need an RTE for it */
@@ -1233,7 +1233,7 @@ convert_EXISTS_sublink_to_join(PlannerInfo *root, SubLink *sublink,
                result->rarg = (Node *) linitial(subselect->jointree->fromlist);
        else
                result->rarg = (Node *) subselect->jointree;
-       result->using = NIL;
+       result->usingClause = NIL;
        result->quals = whereClause;
        result->alias = NULL;
        result->rtindex = 0;            /* we don't need an RTE for it */
index 4f07cad..4640bbd 100644 (file)
@@ -9,7 +9,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/optimizer/util/plancat.c,v 1.158 2009/06/11 14:48:59 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/optimizer/util/plancat.c,v 1.159 2009/07/16 06:33:43 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -783,11 +783,11 @@ build_physical_tlist(PlannerInfo *root, RelOptInfo *rel)
  */
 Selectivity
 restriction_selectivity(PlannerInfo *root,
-                                               Oid operator,
+                                               Oid operatorid,
                                                List *args,
                                                int varRelid)
 {
-       RegProcedure oprrest = get_oprrest(operator);
+       RegProcedure oprrest = get_oprrest(operatorid);
        float8          result;
 
        /*
@@ -799,7 +799,7 @@ restriction_selectivity(PlannerInfo *root,
 
        result = DatumGetFloat8(OidFunctionCall4(oprrest,
                                                                                         PointerGetDatum(root),
-                                                                                        ObjectIdGetDatum(operator),
+                                                                                        ObjectIdGetDatum(operatorid),
                                                                                         PointerGetDatum(args),
                                                                                         Int32GetDatum(varRelid)));
 
@@ -818,12 +818,12 @@ restriction_selectivity(PlannerInfo *root,
  */
 Selectivity
 join_selectivity(PlannerInfo *root,
-                                Oid operator,
+                                Oid operatorid,
                                 List *args,
                                 JoinType jointype,
                                 SpecialJoinInfo *sjinfo)
 {
-       RegProcedure oprjoin = get_oprjoin(operator);
+       RegProcedure oprjoin = get_oprjoin(operatorid);
        float8          result;
 
        /*
@@ -835,7 +835,7 @@ join_selectivity(PlannerInfo *root,
 
        result = DatumGetFloat8(OidFunctionCall5(oprjoin,
                                                                                         PointerGetDatum(root),
-                                                                                        ObjectIdGetDatum(operator),
+                                                                                        ObjectIdGetDatum(operatorid),
                                                                                         PointerGetDatum(args),
                                                                                         Int16GetDatum(jointype),
                                                                                         PointerGetDatum(sjinfo)));
index dfe9b19..1e633ca 100644 (file)
@@ -11,7 +11,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.669 2009/07/14 20:24:10 tgl Exp $
+ *       $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.670 2009/07/16 06:33:43 petere Exp $
  *
  * HISTORY
  *       AUTHOR                        DATE                    MAJOR EVENT
@@ -2127,7 +2127,7 @@ columnDef:        ColId Typename ColQualList
                                {
                                        ColumnDef *n = makeNode(ColumnDef);
                                        n->colname = $1;
-                                       n->typename = $2;
+                                       n->typeName = $2;
                                        n->constraints = $3;
                                        n->is_local = true;
                                        $$ = (Node *)n;
@@ -2574,7 +2574,7 @@ CreateAsElement:
                                {
                                        ColumnDef *n = makeNode(ColumnDef);
                                        n->colname = $1;
-                                       n->typename = NULL;
+                                       n->typeName = NULL;
                                        n->inhcount = 0;
                                        n->is_local = true;
                                        n->is_not_null = false;
@@ -3461,7 +3461,7 @@ DefineStmt:
                        | CREATE TYPE_P any_name AS ENUM_P '(' enum_val_list ')'
                                {
                                        CreateEnumStmt *n = makeNode(CreateEnumStmt);
-                                       n->typename = $3;
+                                       n->typeName = $3;
                                        n->vals = $7;
                                        $$ = (Node *)n;
                                }
@@ -6144,7 +6144,7 @@ CreateDomainStmt:
                                {
                                        CreateDomainStmt *n = makeNode(CreateDomainStmt);
                                        n->domainname = $3;
-                                       n->typename = $5;
+                                       n->typeName = $5;
                                        n->constraints = $6;
                                        $$ = (Node *)n;
                                }
@@ -6156,7 +6156,7 @@ AlterDomainStmt:
                                {
                                        AlterDomainStmt *n = makeNode(AlterDomainStmt);
                                        n->subtype = 'T';
-                                       n->typename = $3;
+                                       n->typeName = $3;
                                        n->def = $4;
                                        $$ = (Node *)n;
                                }
@@ -6165,7 +6165,7 @@ AlterDomainStmt:
                                {
                                        AlterDomainStmt *n = makeNode(AlterDomainStmt);
                                        n->subtype = 'N';
-                                       n->typename = $3;
+                                       n->typeName = $3;
                                        $$ = (Node *)n;
                                }
                        /* ALTER DOMAIN <domain> SET NOT NULL */
@@ -6173,7 +6173,7 @@ AlterDomainStmt:
                                {
                                        AlterDomainStmt *n = makeNode(AlterDomainStmt);
                                        n->subtype = 'O';
-                                       n->typename = $3;
+                                       n->typeName = $3;
                                        $$ = (Node *)n;
                                }
                        /* ALTER DOMAIN <domain> ADD CONSTRAINT ... */
@@ -6181,7 +6181,7 @@ AlterDomainStmt:
                                {
                                        AlterDomainStmt *n = makeNode(AlterDomainStmt);
                                        n->subtype = 'C';
-                                       n->typename = $3;
+                                       n->typeName = $3;
                                        n->def = $5;
                                        $$ = (Node *)n;
                                }
@@ -6190,7 +6190,7 @@ AlterDomainStmt:
                                {
                                        AlterDomainStmt *n = makeNode(AlterDomainStmt);
                                        n->subtype = 'X';
-                                       n->typename = $3;
+                                       n->typeName = $3;
                                        n->name = $6;
                                        n->behavior = $7;
                                        $$ = (Node *)n;
@@ -7463,7 +7463,7 @@ joined_table:
                                        n->isNatural = FALSE;
                                        n->larg = $1;
                                        n->rarg = $4;
-                                       n->using = NIL;
+                                       n->usingClause = NIL;
                                        n->quals = NULL;
                                        $$ = n;
                                }
@@ -7475,7 +7475,7 @@ joined_table:
                                        n->larg = $1;
                                        n->rarg = $4;
                                        if ($5 != NULL && IsA($5, List))
-                                               n->using = (List *) $5; /* USING clause */
+                                               n->usingClause = (List *) $5; /* USING clause */
                                        else
                                                n->quals = $5; /* ON clause */
                                        $$ = n;
@@ -7489,7 +7489,7 @@ joined_table:
                                        n->larg = $1;
                                        n->rarg = $3;
                                        if ($4 != NULL && IsA($4, List))
-                                               n->using = (List *) $4; /* USING clause */
+                                               n->usingClause = (List *) $4; /* USING clause */
                                        else
                                                n->quals = $4; /* ON clause */
                                        $$ = n;
@@ -7501,7 +7501,7 @@ joined_table:
                                        n->isNatural = TRUE;
                                        n->larg = $1;
                                        n->rarg = $5;
-                                       n->using = NIL; /* figure out which columns later... */
+                                       n->usingClause = NIL; /* figure out which columns later... */
                                        n->quals = NULL; /* fill later */
                                        $$ = n;
                                }
@@ -7513,7 +7513,7 @@ joined_table:
                                        n->isNatural = TRUE;
                                        n->larg = $1;
                                        n->rarg = $4;
-                                       n->using = NIL; /* figure out which columns later... */
+                                       n->usingClause = NIL; /* figure out which columns later... */
                                        n->quals = NULL; /* fill later */
                                        $$ = n;
                                }
@@ -7684,7 +7684,7 @@ TableFuncElement: ColId Typename
                                {
                                        ColumnDef *n = makeNode(ColumnDef);
                                        n->colname = $1;
-                                       n->typename = $2;
+                                       n->typeName = $2;
                                        n->constraints = NIL;
                                        n->is_local = true;
                                        $$ = (Node *)n;
@@ -9280,7 +9280,7 @@ func_expr:        func_name '(' ')' over_clause
                                        XmlSerialize *n = makeNode(XmlSerialize);
                                        n->xmloption = $3;
                                        n->expr = $4;
-                                       n->typename = $6;
+                                       n->typeName = $6;
                                        n->location = @1;
                                        $$ = (Node *)n;
                                }
@@ -10668,7 +10668,7 @@ makeTypeCast(Node *arg, TypeName *typename, int location)
 {
        TypeCast *n = makeNode(TypeCast);
        n->arg = arg;
-       n->typename = typename;
+       n->typeName = typename;
        n->location = location;
        return (Node *) n;
 }
index 8a42f5b..139202f 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/parser/parse_clause.c,v 1.189 2009/06/11 14:49:00 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/parser/parse_clause.c,v 1.190 2009/07/16 06:33:43 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -796,7 +796,7 @@ transformFromClauseItem(ParseState *pstate, Node *n,
                        ListCell   *lx,
                                           *rx;
 
-                       Assert(j->using == NIL);        /* shouldn't have USING() too */
+                       Assert(j->usingClause == NIL);  /* shouldn't have USING() too */
 
                        foreach(lx, l_colnames)
                        {
@@ -819,7 +819,7 @@ transformFromClauseItem(ParseState *pstate, Node *n,
                                        rlist = lappend(rlist, m_name);
                        }
 
-                       j->using = rlist;
+                       j->usingClause = rlist;
                }
 
                /*
@@ -828,14 +828,14 @@ transformFromClauseItem(ParseState *pstate, Node *n,
                res_colnames = NIL;
                res_colvars = NIL;
 
-               if (j->using)
+               if (j->usingClause)
                {
                        /*
                         * JOIN/USING (or NATURAL JOIN, as transformed above). Transform
                         * the list into an explicit ON-condition, and generate a list of
                         * merged result columns.
                         */
-                       List       *ucols = j->using;
+                       List       *ucols = j->usingClause;
                        List       *l_usingvars = NIL;
                        List       *r_usingvars = NIL;
                        ListCell   *ucol;
index 08e062d..a8adac1 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/parser/parse_expr.c,v 1.241 2009/06/11 14:49:00 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/parser/parse_expr.c,v 1.242 2009/07/16 06:33:43 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -159,7 +159,7 @@ transformExpr(ParseState *pstate, Node *expr)
                                        Oid                     elementType;
                                        int32           targetTypmod;
 
-                                       targetType = typenameTypeId(pstate, tc->typename,
+                                       targetType = typenameTypeId(pstate, tc->typeName,
                                                                                                &targetTypmod);
                                        elementType = get_element_type(targetType);
                                        if (OidIsValid(elementType))
@@ -1773,7 +1773,7 @@ transformXmlSerialize(ParseState *pstate, XmlSerialize *xs)
                                                                                                         XMLOID,
                                                                                                         "XMLSERIALIZE"));
 
-       targetType = typenameTypeId(pstate, xs->typename, &targetTypmod);
+       targetType = typenameTypeId(pstate, xs->typeName, &targetTypmod);
 
        xexpr->xmloption = xs->xmloption;
        xexpr->location = xs->location;
@@ -2000,7 +2000,7 @@ transformTypeCast(ParseState *pstate, TypeCast *tc)
        int32           targetTypmod;
        int                     location;
 
-       targetType = typenameTypeId(pstate, tc->typename, &targetTypmod);
+       targetType = typenameTypeId(pstate, tc->typeName, &targetTypmod);
 
        if (inputType == InvalidOid)
                return expr;                    /* do nothing if NULL input */
@@ -2012,7 +2012,7 @@ transformTypeCast(ParseState *pstate, TypeCast *tc)
         */
        location = tc->location;
        if (location < 0)
-               location = tc->typename->location;
+               location = tc->typeName->location;
 
        result = coerce_to_target_type(pstate, expr, inputType,
                                                                   targetType, targetTypmod,
index b506c04..b0fb0b6 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/parser/parse_relation.c,v 1.142 2009/06/11 14:49:00 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/parser/parse_relation.c,v 1.143 2009/07/16 06:33:43 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -1188,13 +1188,13 @@ addRangeTableEntryForFunction(ParseState *pstate,
                        int32           attrtypmod;
 
                        attrname = pstrdup(n->colname);
-                       if (n->typename->setof)
+                       if (n->typeName->setof)
                                ereport(ERROR,
                                                (errcode(ERRCODE_INVALID_TABLE_DEFINITION),
                                                 errmsg("column \"%s\" cannot be declared SETOF",
                                                                attrname),
-                                                parser_errposition(pstate, n->typename->location)));
-                       attrtype = typenameTypeId(pstate, n->typename, &attrtypmod);
+                                                parser_errposition(pstate, n->typeName->location)));
+                       attrtype = typenameTypeId(pstate, n->typeName, &attrtypmod);
                        eref->colnames = lappend(eref->colnames, makeString(attrname));
                        rte->funccoltypes = lappend_oid(rte->funccoltypes, attrtype);
                        rte->funccoltypmods = lappend_int(rte->funccoltypmods, attrtypmod);
index c9ec7c3..1635c74 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/parser/parse_target.c,v 1.171 2009/06/11 14:49:00 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/parser/parse_target.c,v 1.172 2009/07/16 06:33:43 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -1373,9 +1373,9 @@ FigureColnameInternal(Node *node, char **name)
                                                                                         name);
                        if (strength <= 1)
                        {
-                               if (((TypeCast *) node)->typename != NULL)
+                               if (((TypeCast *) node)->typeName != NULL)
                                {
-                                       *name = strVal(llast(((TypeCast *) node)->typename->names));
+                                       *name = strVal(llast(((TypeCast *) node)->typeName->names));
                                        return 1;
                                }
                        }
index 295763f..abd0ded 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/parser/parse_type.c,v 1.103 2009/06/11 14:49:00 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/parser/parse_type.c,v 1.104 2009/07/16 06:33:43 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -27,7 +27,7 @@
 #include "utils/syscache.h"
 
 
-static int32 typenameTypeMod(ParseState *pstate, const TypeName *typename,
+static int32 typenameTypeMod(ParseState *pstate, const TypeName *typeName,
                                Type typ);
 
 
@@ -54,57 +54,57 @@ static int32 typenameTypeMod(ParseState *pstate, const TypeName *typename,
  * pstate is only used for error location info, and may be NULL.
  */
 Type
-LookupTypeName(ParseState *pstate, const TypeName *typename,
+LookupTypeName(ParseState *pstate, const TypeName *typeName,
                           int32 *typmod_p)
 {
        Oid                     typoid;
        HeapTuple       tup;
        int32           typmod;
 
-       if (typename->names == NIL)
+       if (typeName->names == NIL)
        {
                /* We have the OID already if it's an internally generated TypeName */
-               typoid = typename->typeid;
+               typoid = typeName->typeOid;
        }
-       else if (typename->pct_type)
+       else if (typeName->pct_type)
        {
                /* Handle %TYPE reference to type of an existing field */
-               RangeVar   *rel = makeRangeVar(NULL, NULL, typename->location);
+               RangeVar   *rel = makeRangeVar(NULL, NULL, typeName->location);
                char       *field = NULL;
                Oid                     relid;
                AttrNumber      attnum;
 
                /* deconstruct the name list */
-               switch (list_length(typename->names))
+               switch (list_length(typeName->names))
                {
                        case 1:
                                ereport(ERROR,
                                                (errcode(ERRCODE_SYNTAX_ERROR),
                                errmsg("improper %%TYPE reference (too few dotted names): %s",
-                                          NameListToString(typename->names)),
-                                                parser_errposition(pstate, typename->location)));
+                                          NameListToString(typeName->names)),
+                                                parser_errposition(pstate, typeName->location)));
                                break;
                        case 2:
-                               rel->relname = strVal(linitial(typename->names));
-                               field = strVal(lsecond(typename->names));
+                               rel->relname = strVal(linitial(typeName->names));
+                               field = strVal(lsecond(typeName->names));
                                break;
                        case 3:
-                               rel->schemaname = strVal(linitial(typename->names));
-                               rel->relname = strVal(lsecond(typename->names));
-                               field = strVal(lthird(typename->names));
+                               rel->schemaname = strVal(linitial(typeName->names));
+                               rel->relname = strVal(lsecond(typeName->names));
+                               field = strVal(lthird(typeName->names));
                                break;
                        case 4:
-                               rel->catalogname = strVal(linitial(typename->names));
-                               rel->schemaname = strVal(lsecond(typename->names));
-                               rel->relname = strVal(lthird(typename->names));
-                               field = strVal(lfourth(typename->names));
+                               rel->catalogname = strVal(linitial(typeName->names));
+                               rel->schemaname = strVal(lsecond(typeName->names));
+                               rel->relname = strVal(lthird(typeName->names));
+                               field = strVal(lfourth(typeName->names));
                                break;
                        default:
                                ereport(ERROR,
                                                (errcode(ERRCODE_SYNTAX_ERROR),
                                                 errmsg("improper %%TYPE reference (too many dotted names): %s",
-                                                               NameListToString(typename->names)),
-                                                parser_errposition(pstate, typename->location)));
+                                                               NameListToString(typeName->names)),
+                                                parser_errposition(pstate, typeName->location)));
                                break;
                }
 
@@ -116,16 +116,16 @@ LookupTypeName(ParseState *pstate, const TypeName *typename,
                                        (errcode(ERRCODE_UNDEFINED_COLUMN),
                                         errmsg("column \"%s\" of relation \"%s\" does not exist",
                                                        field, rel->relname),
-                                        parser_errposition(pstate, typename->location)));
+                                        parser_errposition(pstate, typeName->location)));
                typoid = get_atttype(relid, attnum);
 
                /* this construct should never have an array indicator */
-               Assert(typename->arrayBounds == NIL);
+               Assert(typeName->arrayBounds == NIL);
 
                /* emit nuisance notice (intentionally not errposition'd) */
                ereport(NOTICE,
                                (errmsg("type reference %s converted to %s",
-                                               TypeNameToString(typename),
+                                               TypeNameToString(typeName),
                                                format_type_be(typoid))));
        }
        else
@@ -135,7 +135,7 @@ LookupTypeName(ParseState *pstate, const TypeName *typename,
                char       *typname;
 
                /* deconstruct the name list */
-               DeconstructQualifiedName(typename->names, &schemaname, &typname);
+               DeconstructQualifiedName(typeName->names, &schemaname, &typname);
 
                if (schemaname)
                {
@@ -155,7 +155,7 @@ LookupTypeName(ParseState *pstate, const TypeName *typename,
                }
 
                /* If an array reference, return the array type instead */
-               if (typename->arrayBounds != NIL)
+               if (typeName->arrayBounds != NIL)
                        typoid = get_array_type(typoid);
        }
 
@@ -172,7 +172,7 @@ LookupTypeName(ParseState *pstate, const TypeName *typename,
        if (!HeapTupleIsValid(tup)) /* should not happen */
                elog(ERROR, "cache lookup failed for type %u", typoid);
 
-       typmod = typenameTypeMod(pstate, typename, (Type) tup);
+       typmod = typenameTypeMod(pstate, typeName, (Type) tup);
 
        if (typmod_p)
                *typmod_p = typmod;
@@ -188,23 +188,23 @@ LookupTypeName(ParseState *pstate, const TypeName *typename,
  * Callers of this can therefore assume the result is a fully valid type.
  */
 Type
-typenameType(ParseState *pstate, const TypeName *typename, int32 *typmod_p)
+typenameType(ParseState *pstate, const TypeName *typeName, int32 *typmod_p)
 {
        Type            tup;
 
-       tup = LookupTypeName(pstate, typename, typmod_p);
+       tup = LookupTypeName(pstate, typeName, typmod_p);
        if (tup == NULL)
                ereport(ERROR,
                                (errcode(ERRCODE_UNDEFINED_OBJECT),
                                 errmsg("type \"%s\" does not exist",
-                                               TypeNameToString(typename)),
-                                parser_errposition(pstate, typename->location)));
+                                               TypeNameToString(typeName)),
+                                parser_errposition(pstate, typeName->location)));
        if (!((Form_pg_type) GETSTRUCT(tup))->typisdefined)
                ereport(ERROR,
                                (errcode(ERRCODE_UNDEFINED_OBJECT),
                                 errmsg("type \"%s\" is only a shell",
-                                               TypeNameToString(typename)),
-                                parser_errposition(pstate, typename->location)));
+                                               TypeNameToString(typeName)),
+                                parser_errposition(pstate, typeName->location)));
        return tup;
 }
 
@@ -215,12 +215,12 @@ typenameType(ParseState *pstate, const TypeName *typename, int32 *typmod_p)
  * not the syscache entry.
  */
 Oid
-typenameTypeId(ParseState *pstate, const TypeName *typename, int32 *typmod_p)
+typenameTypeId(ParseState *pstate, const TypeName *typeName, int32 *typmod_p)
 {
        Oid                     typoid;
        Type            tup;
 
-       tup = typenameType(pstate, typename, typmod_p);
+       tup = typenameType(pstate, typeName, typmod_p);
        typoid = HeapTupleGetOid(tup);
        ReleaseSysCache(tup);
 
@@ -239,7 +239,7 @@ typenameTypeId(ParseState *pstate, const TypeName *typename, int32 *typmod_p)
  * pstate is only used for error location info, and may be NULL.
  */
 static int32
-typenameTypeMod(ParseState *pstate, const TypeName *typename, Type typ)
+typenameTypeMod(ParseState *pstate, const TypeName *typeName, Type typ)
 {
        int32           result;
        Oid                     typmodin;
@@ -250,8 +250,8 @@ typenameTypeMod(ParseState *pstate, const TypeName *typename, Type typ)
        ParseCallbackState pcbstate;
 
        /* Return prespecified typmod if no typmod expressions */
-       if (typename->typmods == NIL)
-               return typename->typemod;
+       if (typeName->typmods == NIL)
+               return typeName->typemod;
 
        /*
         * Else, type had better accept typmods.  We give a special error message
@@ -262,8 +262,8 @@ typenameTypeMod(ParseState *pstate, const TypeName *typename, Type typ)
                ereport(ERROR,
                                (errcode(ERRCODE_SYNTAX_ERROR),
                        errmsg("type modifier cannot be specified for shell type \"%s\"",
-                                  TypeNameToString(typename)),
-                                parser_errposition(pstate, typename->location)));
+                                  TypeNameToString(typeName)),
+                                parser_errposition(pstate, typeName->location)));
 
        typmodin = ((Form_pg_type) GETSTRUCT(typ))->typmodin;
 
@@ -271,17 +271,17 @@ typenameTypeMod(ParseState *pstate, const TypeName *typename, Type typ)
                ereport(ERROR,
                                (errcode(ERRCODE_SYNTAX_ERROR),
                                 errmsg("type modifier is not allowed for type \"%s\"",
-                                               TypeNameToString(typename)),
-                                parser_errposition(pstate, typename->location)));
+                                               TypeNameToString(typeName)),
+                                parser_errposition(pstate, typeName->location)));
 
        /*
         * Convert the list of raw-grammar-output expressions to a cstring array.
         * Currently, we allow simple numeric constants, string literals, and
         * identifiers; possibly this list could be extended.
         */
-       datums = (Datum *) palloc(list_length(typename->typmods) * sizeof(Datum));
+       datums = (Datum *) palloc(list_length(typeName->typmods) * sizeof(Datum));
        n = 0;
-       foreach(l, typename->typmods)
+       foreach(l, typeName->typmods)
        {
                Node       *tm = (Node *) lfirst(l);
                char       *cstr = NULL;
@@ -314,7 +314,7 @@ typenameTypeMod(ParseState *pstate, const TypeName *typename, Type typ)
                        ereport(ERROR,
                                        (errcode(ERRCODE_SYNTAX_ERROR),
                        errmsg("type modifiers must be simple constants or identifiers"),
-                                        parser_errposition(pstate, typename->location)));
+                                        parser_errposition(pstate, typeName->location)));
                datums[n++] = CStringGetDatum(cstr);
        }
 
@@ -323,7 +323,7 @@ typenameTypeMod(ParseState *pstate, const TypeName *typename, Type typ)
                                                                -2, false, 'c');
 
        /* arrange to report location if type's typmodin function fails */
-       setup_parser_errposition_callback(&pcbstate, pstate, typename->location);
+       setup_parser_errposition_callback(&pcbstate, pstate, typeName->location);
 
        result = DatumGetInt32(OidFunctionCall1(typmodin,
                                                                                        PointerGetDatum(arrtypmod)));
@@ -345,16 +345,16 @@ typenameTypeMod(ParseState *pstate, const TypeName *typename, Type typ)
  * it is mostly used for reporting lookup errors.
  */
 static void
-appendTypeNameToBuffer(const TypeName *typename, StringInfo string)
+appendTypeNameToBuffer(const TypeName *typeName, StringInfo string)
 {
-       if (typename->names != NIL)
+       if (typeName->names != NIL)
        {
                /* Emit possibly-qualified name as-is */
                ListCell   *l;
 
-               foreach(l, typename->names)
+               foreach(l, typeName->names)
                {
-                       if (l != list_head(typename->names))
+                       if (l != list_head(typeName->names))
                                appendStringInfoChar(string, '.');
                        appendStringInfoString(string, strVal(lfirst(l)));
                }
@@ -362,17 +362,17 @@ appendTypeNameToBuffer(const TypeName *typename, StringInfo string)
        else
        {
                /* Look up internally-specified type */
-               appendStringInfoString(string, format_type_be(typename->typeid));
+               appendStringInfoString(string, format_type_be(typeName->typeOid));
        }
 
        /*
         * Add decoration as needed, but only for fields considered by
         * LookupTypeName
         */
-       if (typename->pct_type)
+       if (typeName->pct_type)
                appendStringInfoString(string, "%TYPE");
 
-       if (typename->arrayBounds != NIL)
+       if (typeName->arrayBounds != NIL)
                appendStringInfoString(string, "[]");
 }
 
@@ -384,12 +384,12 @@ appendTypeNameToBuffer(const TypeName *typename, StringInfo string)
  * it is mostly used for reporting lookup errors.
  */
 char *
-TypeNameToString(const TypeName *typename)
+TypeNameToString(const TypeName *typeName)
 {
        StringInfoData string;
 
        initStringInfo(&string);
-       appendTypeNameToBuffer(typename, &string);
+       appendTypeNameToBuffer(typeName, &string);
        return string.data;
 }
 
@@ -406,12 +406,12 @@ TypeNameListToString(List *typenames)
        initStringInfo(&string);
        foreach(l, typenames)
        {
-               TypeName   *typename = (TypeName *) lfirst(l);
+               TypeName   *typeName = (TypeName *) lfirst(l);
 
-               Assert(IsA(typename, TypeName));
+               Assert(IsA(typeName, TypeName));
                if (l != list_head(typenames))
                        appendStringInfoChar(&string, ',');
-               appendTypeNameToBuffer(typename, &string);
+               appendTypeNameToBuffer(typeName, &string);
        }
        return string.data;
 }
@@ -575,7 +575,7 @@ parseTypeString(const char *str, Oid *type_id, int32 *typmod_p)
        SelectStmt *stmt;
        ResTarget  *restarget;
        TypeCast   *typecast;
-       TypeName   *typename;
+       TypeName   *typeName;
        ErrorContextCallback ptserrcontext;
 
        /* make sure we give useful error for empty input */
@@ -635,14 +635,14 @@ parseTypeString(const char *str, Oid *type_id, int32 *typmod_p)
                typecast->arg == NULL ||
                !IsA(typecast->arg, A_Const))
                goto fail;
-       typename = typecast->typename;
-       if (typename == NULL ||
-               !IsA(typename, TypeName))
+       typeName = typecast->typeName;
+       if (typeName == NULL ||
+               !IsA(typeName, TypeName))
                goto fail;
-       if (typename->setof)
+       if (typeName->setof)
                goto fail;
 
-       *type_id = typenameTypeId(NULL, typename, typmod_p);
+       *type_id = typenameTypeId(NULL, typeName, typmod_p);
 
        pfree(buf.data);
 
index 0c93f58..a5d805a 100644 (file)
@@ -19,7 +19,7 @@
  * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- *     $PostgreSQL: pgsql/src/backend/parser/parse_utilcmd.c,v 2.22 2009/07/12 17:12:34 tgl Exp $
+ *     $PostgreSQL: pgsql/src/backend/parser/parse_utilcmd.c,v 2.23 2009/07/16 06:33:43 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -266,24 +266,24 @@ transformColumnDefinition(ParseState *pstate, CreateStmtContext *cxt,
 
        /* Check for SERIAL pseudo-types */
        is_serial = false;
-       if (list_length(column->typename->names) == 1 &&
-               !column->typename->pct_type)
+       if (list_length(column->typeName->names) == 1 &&
+               !column->typeName->pct_type)
        {
-               char       *typname = strVal(linitial(column->typename->names));
+               char       *typname = strVal(linitial(column->typeName->names));
 
                if (strcmp(typname, "serial") == 0 ||
                        strcmp(typname, "serial4") == 0)
                {
                        is_serial = true;
-                       column->typename->names = NIL;
-                       column->typename->typeid = INT4OID;
+                       column->typeName->names = NIL;
+                       column->typeName->typeOid = INT4OID;
                }
                else if (strcmp(typname, "bigserial") == 0 ||
                                 strcmp(typname, "serial8") == 0)
                {
                        is_serial = true;
-                       column->typename->names = NIL;
-                       column->typename->typeid = INT8OID;
+                       column->typeName->names = NIL;
+                       column->typeName->typeOid = INT8OID;
                }
 
                /*
@@ -291,7 +291,7 @@ transformColumnDefinition(ParseState *pstate, CreateStmtContext *cxt,
                 * typeid, LookupTypeName won't notice arrayBounds.  We don't need any
                 * special coding for serial(typmod) though.
                 */
-               if (is_serial && column->typename->arrayBounds != NIL)
+               if (is_serial && column->typeName->arrayBounds != NIL)
                        ereport(ERROR,
                                        (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
                                         errmsg("array of serial is not implemented")));
@@ -382,7 +382,7 @@ transformColumnDefinition(ParseState *pstate, CreateStmtContext *cxt,
                snamenode->val.val.str = qstring;
                snamenode->location = -1;
                castnode = makeNode(TypeCast);
-               castnode->typename = SystemTypeName("regclass");
+               castnode->typeName = SystemTypeName("regclass");
                castnode->arg = (Node *) snamenode;
                castnode->location = -1;
                funccallnode = makeNode(FuncCall);
@@ -623,7 +623,7 @@ transformInhRelation(ParseState *pstate, CreateStmtContext *cxt,
                 */
                def = makeNode(ColumnDef);
                def->colname = pstrdup(attributeName);
-               def->typename = makeTypeNameFromOid(attribute->atttypid,
+               def->typeName = makeTypeNameFromOid(attribute->atttypid,
                                                                                        attribute->atttypmod);
                def->inhcount = 0;
                def->is_local = true;
@@ -1969,7 +1969,7 @@ transformColumnType(ParseState *pstate, ColumnDef *column)
        /*
         * All we really need to do here is verify that the type is valid.
         */
-       Type            ctype = typenameType(pstate, column->typename, NULL);
+       Type            ctype = typenameType(pstate, column->typeName, NULL);
 
        ReleaseSysCache(ctype);
 }
index f51f90f..bda06a3 100644 (file)
@@ -10,7 +10,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/tcop/utility.c,v 1.309 2009/06/11 20:46:11 tgl Exp $
+ *       $PostgreSQL: pgsql/src/backend/tcop/utility.c,v 1.310 2009/07/16 06:33:44 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -665,23 +665,23 @@ ProcessUtility(Node *parsetree,
                                                 * Recursively alter column default for table and, if
                                                 * requested, for descendants
                                                 */
-                                               AlterDomainDefault(stmt->typename,
+                                               AlterDomainDefault(stmt->typeName,
                                                                                   stmt->def);
                                                break;
                                        case 'N':       /* ALTER DOMAIN DROP NOT NULL */
-                                               AlterDomainNotNull(stmt->typename,
+                                               AlterDomainNotNull(stmt->typeName,
                                                                                   false);
                                                break;
                                        case 'O':       /* ALTER DOMAIN SET NOT NULL */
-                                               AlterDomainNotNull(stmt->typename,
+                                               AlterDomainNotNull(stmt->typeName,
                                                                                   true);
                                                break;
                                        case 'C':       /* ADD CONSTRAINT */
-                                               AlterDomainAddConstraint(stmt->typename,
+                                               AlterDomainAddConstraint(stmt->typeName,
                                                                                                 stmt->def);
                                                break;
                                        case 'X':       /* DROP CONSTRAINT */
-                                               AlterDomainDropConstraint(stmt->typename,
+                                               AlterDomainDropConstraint(stmt->typeName,
                                                                                                  stmt->name,
                                                                                                  stmt->behavior);
                                                break;
index c7097fc..4befc72 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/tsearch/dict_thesaurus.c,v 1.13 2009/01/01 17:23:48 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/tsearch/dict_thesaurus.c,v 1.14 2009/07/16 06:33:44 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -800,7 +800,7 @@ thesaurus_lexize(PG_FUNCTION_ARGS)
 
        if (dstate->isend)
                PG_RETURN_POINTER(NULL);
-       stored = (LexemeInfo *) dstate->private;
+       stored = (LexemeInfo *) dstate->private_state;
 
        if (stored)
                curpos = stored->posinsubst + 1;
@@ -859,7 +859,7 @@ thesaurus_lexize(PG_FUNCTION_ARGS)
                info = NULL;                    /* word isn't recognized */
        }
 
-       dstate->private = (void *) info;
+       dstate->private_state = (void *) info;
 
        if (!info)
        {
index ccafe5f..f503306 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/tsearch/ts_parse.c,v 1.12 2009/06/11 14:49:03 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/tsearch/ts_parse.c,v 1.13 2009/07/16 06:33:44 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -204,7 +204,7 @@ LexizeExec(LexizeData *ld, ParsedLex **correspondLexem)
                                dict = lookup_ts_dictionary_cache(map->dictIds[i]);
 
                                ld->dictState.isend = ld->dictState.getnext = false;
-                               ld->dictState.private = NULL;
+                               ld->dictState.private_state = NULL;
                                res = (TSLexeme *) DatumGetPointer(FunctionCall4(
                                                                                                                         &(dict->lexize),
                                                                                         PointerGetDatum(dict->dictData),
@@ -464,18 +464,18 @@ hlfinditem(HeadlineParsedText *prs, TSQuery query, char *buf, int buflen)
        for (i = 0; i < query->size; i++)
        {
                if (item->type == QI_VAL &&
-                       tsCompareString(GETOPERAND(query) + item->operand.distance, item->operand.length,
-                                                       buf, buflen, item->operand.prefix) == 0)
+                       tsCompareString(GETOPERAND(query) + item->qoperand.distance, item->qoperand.length,
+                                                       buf, buflen, item->qoperand.prefix) == 0)
                {
                        if (word->item)
                        {
                                memcpy(&(prs->words[prs->curwords]), word, sizeof(HeadlineWordEntry));
-                               prs->words[prs->curwords].item = &item->operand;
+                               prs->words[prs->curwords].item = &item->qoperand;
                                prs->words[prs->curwords].repeated = 1;
                                prs->curwords++;
                        }
                        else
-                               word->item = &item->operand;
+                               word->item = &item->qoperand;
                }
                item++;
        }
index d0ffb0c..c0e7012 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/tsearch/ts_selfuncs.c,v 1.4 2009/06/11 14:49:03 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/tsearch/ts_selfuncs.c,v 1.5 2009/07/16 06:33:44 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -307,7 +307,7 @@ tsquery_opr_selec(QueryItem *item, char *operand,
        }
 
        /* Current TSQuery node is an operator */
-       switch (item->operator.oper)
+       switch (item->qoperator.oper)
        {
                case OP_NOT:
                        selec = 1.0 - tsquery_opr_selec(item + 1, operand,
@@ -317,7 +317,7 @@ tsquery_opr_selec(QueryItem *item, char *operand,
                case OP_AND:
                        s1 = tsquery_opr_selec(item + 1, operand,
                                                                   lookup, length, minfreq);
-                       s2 = tsquery_opr_selec(item + item->operator.left, operand,
+                       s2 = tsquery_opr_selec(item + item->qoperator.left, operand,
                                                                   lookup, length, minfreq);
                        selec = s1 * s2;
                        break;
@@ -325,13 +325,13 @@ tsquery_opr_selec(QueryItem *item, char *operand,
                case OP_OR:
                        s1 = tsquery_opr_selec(item + 1, operand,
                                                                   lookup, length, minfreq);
-                       s2 = tsquery_opr_selec(item + item->operator.left, operand,
+                       s2 = tsquery_opr_selec(item + item->qoperator.left, operand,
                                                                   lookup, length, minfreq);
                        selec = s1 + s2 - s1 * s2;
                        break;
 
                default:
-                       elog(ERROR, "unrecognized operator: %d", item->operator.oper);
+                       elog(ERROR, "unrecognized operator: %d", item->qoperator.oper);
                        selec = 0;                      /* keep compiler quiet */
                        break;
        }
index d7d72af..3d3409d 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/tsearch/wparser_def.c,v 1.23 2009/03/11 16:03:40 teodor Exp $
+ *       $PostgreSQL: pgsql/src/backend/tsearch/wparser_def.c,v 1.24 2009/07/16 06:33:44 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -1950,7 +1950,7 @@ hlCover(HeadlineParsedText *prs, TSQuery query, int *p, int *q)
                }
                for (i = pos; i < prs->curwords; i++)
                {
-                       if (prs->words[i].item == &item->operand)
+                       if (prs->words[i].item == &item->qoperand)
                        {
                                if (i > *q)
                                        *q = i;
@@ -1973,7 +1973,7 @@ hlCover(HeadlineParsedText *prs, TSQuery query, int *p, int *q)
                }
                for (i = *q; i >= pos; i--)
                {
-                       if (prs->words[i].item == &item->operand)
+                       if (prs->words[i].item == &item->qoperand)
                        {
                                if (i < *p)
                                        *p = i;
index d30db3a..4345a52 100644 (file)
@@ -9,7 +9,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.302 2009/07/14 20:24:10 tgl Exp $
+ *       $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.303 2009/07/16 06:33:44 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -5910,14 +5910,14 @@ get_from_clause_item(Node *jtnode, Query *query, deparse_context *context)
 
                if (!j->isNatural)
                {
-                       if (j->using)
+                       if (j->usingClause)
                        {
                                ListCell   *col;
 
                                appendStringInfo(buf, " USING (");
-                               foreach(col, j->using)
+                               foreach(col, j->usingClause)
                                {
-                                       if (col != list_head(j->using))
+                                       if (col != list_head(j->usingClause))
                                                appendStringInfo(buf, ", ");
                                        appendStringInfoString(buf,
                                                                          quote_identifier(strVal(lfirst(col))));
@@ -6251,18 +6251,18 @@ quote_identifier(const char *ident)
 /*
  * quote_qualified_identifier  - Quote a possibly-qualified identifier
  *
- * Return a name of the form namespace.ident, or just ident if namespace
+ * Return a name of the form qualifier.ident, or just ident if qualifier
  * is NULL, quoting each component if necessary.  The result is palloc'd.
  */
 char *
-quote_qualified_identifier(const char *namespace,
+quote_qualified_identifier(const char *qualifier,
                                                   const char *ident)
 {
        StringInfoData buf;
 
        initStringInfo(&buf);
-       if (namespace)
-               appendStringInfo(&buf, "%s.", quote_identifier(namespace));
+       if (qualifier)
+               appendStringInfo(&buf, "%s.", quote_identifier(qualifier));
        appendStringInfoString(&buf, quote_identifier(ident));
        return buf.data;
 }
index 6b43585..9cba21f 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/utils/adt/tsginidx.c,v 1.16 2009/06/11 14:49:04 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/utils/adt/tsginidx.c,v 1.17 2009/07/16 06:33:44 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -142,7 +142,7 @@ gin_extract_tsquery(PG_FUNCTION_ARGS)
                        if (item[i].type == QI_VAL)
                        {
                                text       *txt;
-                               QueryOperand *val = &item[i].operand;
+                               QueryOperand *val = &item[i].qoperand;
 
                                txt = cstring_to_text_with_len(GETOPERAND(query) + val->distance,
                                                                                           val->length);
index 7ca8467..f0dcd22 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/utils/adt/tsquery.c,v 1.20 2009/06/11 14:49:04 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/utils/adt/tsquery.c,v 1.21 2009/07/16 06:33:44 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -419,15 +419,15 @@ findoprnd_recurse(QueryItem *ptr, uint32 *pos, int nnodes)
        {
                Assert(ptr[*pos].type == QI_OPR);
 
-               if (ptr[*pos].operator.oper == OP_NOT)
+               if (ptr[*pos].qoperator.oper == OP_NOT)
                {
-                       ptr[*pos].operator.left = 1;
+                       ptr[*pos].qoperator.left = 1;
                        (*pos)++;
                        findoprnd_recurse(ptr, pos, nnodes);
                }
                else
                {
-                       QueryOperator *curitem = &ptr[*pos].operator;
+                       QueryOperator *curitem = &ptr[*pos].qoperator;
                        int                     tmp = *pos;
 
                        Assert(curitem->oper == OP_AND || curitem->oper == OP_OR);
@@ -611,7 +611,7 @@ infix(INFIX *in, bool first)
 
        if (in->curpol->type == QI_VAL)
        {
-               QueryOperand *curpol = &in->curpol->operand;
+               QueryOperand *curpol = &in->curpol->qoperand;
                char       *op = in->op + curpol->distance;
                int                     clen;
 
@@ -671,7 +671,7 @@ infix(INFIX *in, bool first)
                *(in->cur) = '\0';
                in->curpol++;
        }
-       else if (in->curpol->operator.oper == OP_NOT)
+       else if (in->curpol->qoperator.oper == OP_NOT)
        {
                bool            isopr = false;
 
@@ -699,7 +699,7 @@ infix(INFIX *in, bool first)
        }
        else
        {
-               int8            op = in->curpol->operator.oper;
+               int8            op = in->curpol->qoperator.oper;
                INFIX           nrm;
 
                in->curpol++;
@@ -808,12 +808,12 @@ tsquerysend(PG_FUNCTION_ARGS)
                switch (item->type)
                {
                        case QI_VAL:
-                               pq_sendint(&buf, item->operand.weight, sizeof(uint8));
-                               pq_sendint(&buf, item->operand.prefix, sizeof(uint8));
-                               pq_sendstring(&buf, GETOPERAND(query) + item->operand.distance);
+                               pq_sendint(&buf, item->qoperand.weight, sizeof(uint8));
+                               pq_sendint(&buf, item->qoperand.prefix, sizeof(uint8));
+                               pq_sendstring(&buf, GETOPERAND(query) + item->qoperand.distance);
                                break;
                        case QI_OPR:
-                               pq_sendint(&buf, item->operator.oper, sizeof(item->operator.oper));
+                               pq_sendint(&buf, item->qoperator.oper, sizeof(item->qoperator.oper));
                                break;
                        default:
                                elog(ERROR, "unrecognized tsquery node type: %d", item->type);
@@ -887,11 +887,11 @@ tsqueryrecv(PG_FUNCTION_ARGS)
                        COMP_CRC32(valcrc, val, val_len);
                        FIN_CRC32(valcrc);
 
-                       item->operand.weight = weight;
-                       item->operand.prefix = (prefix) ? true : false;
-                       item->operand.valcrc = (int32) valcrc;
-                       item->operand.length = val_len;
-                       item->operand.distance = datalen;
+                       item->qoperand.weight = weight;
+                       item->qoperand.prefix = (prefix) ? true : false;
+                       item->qoperand.valcrc = (int32) valcrc;
+                       item->qoperand.length = val_len;
+                       item->qoperand.distance = datalen;
 
                        /*
                         * Operand strings are copied to the final struct after this loop;
@@ -912,7 +912,7 @@ tsqueryrecv(PG_FUNCTION_ARGS)
                        if (i == size - 1)
                                elog(ERROR, "invalid pointer to right operand");
 
-                       item->operator.oper = oper;
+                       item->qoperator.oper = oper;
                }
                else
                        elog(ERROR, "unrecognized tsquery node type: %d", item->type);
@@ -936,8 +936,8 @@ tsqueryrecv(PG_FUNCTION_ARGS)
        {
                if (item->type == QI_VAL)
                {
-                       memcpy(ptr, operands[i], item->operand.length + 1);
-                       ptr += item->operand.length + 1;
+                       memcpy(ptr, operands[i], item->qoperand.length + 1);
+                       ptr += item->qoperand.length + 1;
                }
                item++;
        }
index 4a0b83f..e8d0f71 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_cleanup.c,v 1.11 2009/01/01 17:23:50 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_cleanup.c,v 1.12 2009/07/16 06:33:44 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -39,8 +39,8 @@ maketree(QueryItem *in)
        if (in->type == QI_OPR)
        {
                node->right = maketree(in + 1);
-               if (in->operator.oper != OP_NOT)
-                       node->left = maketree(in + in->operator.left);
+               if (in->qoperator.oper != OP_NOT)
+                       node->left = maketree(in + in->qoperator.left);
        }
        return node;
 }
@@ -69,9 +69,9 @@ plainnode(PLAINTREE *state, NODE *node)
        memcpy((void *) &(state->ptr[state->cur]), (void *) node->valnode, sizeof(QueryItem));
        if (node->valnode->type == QI_VAL)
                state->cur++;
-       else if (node->valnode->operator.oper == OP_NOT)
+       else if (node->valnode->qoperator.oper == OP_NOT)
        {
-               state->ptr[state->cur].operator.left = 1;
+               state->ptr[state->cur].qoperator.left = 1;
                state->cur++;
                plainnode(state, node->right);
        }
@@ -81,7 +81,7 @@ plainnode(PLAINTREE *state, NODE *node)
 
                state->cur++;
                plainnode(state, node->right);
-               state->ptr[cur].operator.left = state->cur - cur;
+               state->ptr[cur].qoperator.left = state->cur - cur;
                plainnode(state, node->left);
        }
        pfree(node);
@@ -138,14 +138,14 @@ clean_NOT_intree(NODE *node)
        if (node->valnode->type == QI_VAL)
                return node;
 
-       if (node->valnode->operator.oper == OP_NOT)
+       if (node->valnode->qoperator.oper == OP_NOT)
        {
                freetree(node);
                return NULL;
        }
 
        /* operator & or | */
-       if (node->valnode->operator.oper == OP_OR)
+       if (node->valnode->qoperator.oper == OP_OR)
        {
                if ((node->left = clean_NOT_intree(node->left)) == NULL ||
                        (node->right = clean_NOT_intree(node->right)) == NULL)
@@ -158,7 +158,7 @@ clean_NOT_intree(NODE *node)
        {
                NODE       *res = node;
 
-               Assert(node->valnode->operator.oper == OP_AND);
+               Assert(node->valnode->qoperator.oper == OP_AND);
 
                node->left = clean_NOT_intree(node->left);
                node->right = clean_NOT_intree(node->right);
@@ -233,7 +233,7 @@ clean_fakeval_intree(NODE *node, char *result)
 
        Assert(node->valnode->type == QI_OPR);
 
-       if (node->valnode->operator.oper == OP_NOT)
+       if (node->valnode->qoperator.oper == OP_NOT)
        {
                node->right = clean_fakeval_intree(node->right, &rresult);
                if (!node->right)
index 6b7e976..9f1b054 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_op.c,v 1.6 2009/06/11 14:49:04 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_op.c,v 1.7 2009/07/16 06:33:44 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -38,7 +38,7 @@ join_tsqueries(TSQuery a, TSQuery b, int8 operator)
 
        res->valnode = (QueryItem *) palloc0(sizeof(QueryItem));
        res->valnode->type = QI_OPR;
-       res->valnode->operator.oper = operator;
+       res->valnode->qoperator.oper = operator;
 
        res->child = (QTNode **) palloc0(sizeof(QTNode *) * 2);
        res->child[0] = QT2QTN(GETQUERY(b), GETOPERAND(b));
@@ -124,7 +124,7 @@ tsquery_not(PG_FUNCTION_ARGS)
 
        res->valnode = (QueryItem *) palloc0(sizeof(QueryItem));
        res->valnode->type = QI_OPR;
-       res->valnode->operator.oper = OP_NOT;
+       res->valnode->qoperator.oper = OP_NOT;
 
        res->child = (QTNode **) palloc0(sizeof(QTNode *));
        res->child[0] = QT2QTN(GETQUERY(a), GETOPERAND(a));
@@ -209,7 +209,7 @@ makeTSQuerySign(TSQuery a)
        for (i = 0; i < a->size; i++)
        {
                if (ptr->type == QI_VAL)
-                       sign |= ((TSQuerySign) 1) << (ptr->operand.valcrc % TSQS_SIGLEN);
+                       sign |= ((TSQuerySign) 1) << (ptr->qoperand.valcrc % TSQS_SIGLEN);
                ptr++;
        }
 
@@ -255,7 +255,7 @@ tsq_mcontains(PG_FUNCTION_ARGS)
                if (ie[i].type != QI_VAL)
                        continue;
                for (j = 0; j < query->size; j++)
-                       if (iq[j].type == QI_VAL && ie[i].operand.valcrc == iq[j].operand.valcrc)
+                       if (iq[j].type == QI_VAL && ie[i].qoperand.valcrc == iq[j].qoperand.valcrc)
                        {
                                j = query->size + 1;
                                break;
index 22db860..981c729 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_rewrite.c,v 1.14 2009/01/07 13:44:36 tgl Exp $
+ *       $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_rewrite.c,v 1.15 2009/07/16 06:33:44 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -57,7 +57,7 @@ findeq(QTNode *node, QTNode *ex, QTNode *subs, bool *isfind)
 
        if (node->valnode->type == QI_OPR)
        {
-               if (node->valnode->operator.oper != ex->valnode->operator.oper)
+               if (node->valnode->qoperator.oper != ex->valnode->qoperator.oper)
                        return node;
 
                if (node->nchild == ex->nchild)
@@ -154,7 +154,7 @@ findeq(QTNode *node, QTNode *ex, QTNode *subs, bool *isfind)
        {
                Assert(node->valnode->type == QI_VAL);
 
-               if (node->valnode->operand.valcrc != ex->valnode->operand.valcrc)
+               if (node->valnode->qoperand.valcrc != ex->valnode->qoperand.valcrc)
                        return node;
                else if (QTNEq(node, ex))
                {
@@ -217,7 +217,7 @@ dropvoidsubtree(QTNode *root)
 
                root->nchild = j;
 
-               if (root->valnode->operator.oper == OP_NOT && root->nchild == 0)
+               if (root->valnode->qoperator.oper == OP_NOT && root->nchild == 0)
                {
                        QTNFree(root);
                        root = NULL;
index 9efd5fa..03a5f68 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_util.c,v 1.11 2009/06/11 14:49:04 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_util.c,v 1.12 2009/07/16 06:33:44 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -33,19 +33,19 @@ QT2QTN(QueryItem *in, char *operand)
                node->child = (QTNode **) palloc0(sizeof(QTNode *) * 2);
                node->child[0] = QT2QTN(in + 1, operand);
                node->sign = node->child[0]->sign;
-               if (in->operator.oper == OP_NOT)
+               if (in->qoperator.oper == OP_NOT)
                        node->nchild = 1;
                else
                {
                        node->nchild = 2;
-                       node->child[1] = QT2QTN(in + in->operator.left, operand);
+                       node->child[1] = QT2QTN(in + in->qoperator.left, operand);
                        node->sign |= node->child[1]->sign;
                }
        }
        else if (operand)
        {
-               node->word = operand + in->operand.distance;
-               node->sign = 1 << (in->operand.valcrc % 32);
+               node->word = operand + in->qoperand.distance;
+               node->sign = 1 << (in->qoperand.valcrc % 32);
        }
 
        return node;
@@ -94,8 +94,8 @@ QTNodeCompare(QTNode *an, QTNode *bn)
 
        if (an->valnode->type == QI_OPR)
        {
-               QueryOperator *ao = &an->valnode->operator;
-               QueryOperator *bo = &bn->valnode->operator;
+               QueryOperator *ao = &an->valnode->qoperator;
+               QueryOperator *bo = &bn->valnode->qoperator;
 
                if (ao->oper != bo->oper)
                        return (ao->oper > bo->oper) ? -1 : 1;
@@ -115,8 +115,8 @@ QTNodeCompare(QTNode *an, QTNode *bn)
        }
        else
        {
-               QueryOperand *ao = &an->valnode->operand;
-               QueryOperand *bo = &bn->valnode->operand;
+               QueryOperand *ao = &an->valnode->qoperand;
+               QueryOperand *bo = &bn->valnode->qoperand;
 
                Assert(an->valnode->type == QI_VAL);
 
@@ -188,7 +188,7 @@ QTNTernary(QTNode *in)
        {
                QTNode     *cc = in->child[i];
 
-               if (cc->valnode->type == QI_OPR && in->valnode->operator.oper == cc->valnode->operator.oper)
+               if (cc->valnode->type == QI_OPR && in->valnode->qoperator.oper == cc->valnode->qoperator.oper)
                {
                        int                     oldnchild = in->nchild;
 
@@ -245,7 +245,7 @@ QTNBinary(QTNode *in)
                nn->sign = nn->child[0]->sign | nn->child[1]->sign;
 
                nn->valnode->type = in->valnode->type;
-               nn->valnode->operator.oper = in->valnode->operator.oper;
+               nn->valnode->qoperator.oper = in->valnode->qoperator.oper;
 
                in->child[0] = nn;
                in->child[1] = in->child[in->nchild - 1];
@@ -273,7 +273,7 @@ cntsize(QTNode *in, int *sumlen, int *nnode)
        }
        else
        {
-               *sumlen += in->valnode->operand.length + 1;
+               *sumlen += in->valnode->qoperand.length + 1;
        }
 }
 
@@ -294,10 +294,10 @@ fillQT(QTN2QTState *state, QTNode *in)
        {
                memcpy(state->curitem, in->valnode, sizeof(QueryOperand));
 
-               memcpy(state->curoperand, in->word, in->valnode->operand.length);
-               state->curitem->operand.distance = state->curoperand - state->operand;
-               state->curoperand[in->valnode->operand.length] = '\0';
-               state->curoperand += in->valnode->operand.length + 1;
+               memcpy(state->curoperand, in->word, in->valnode->qoperand.length);
+               state->curitem->qoperand.distance = state->curoperand - state->operand;
+               state->curoperand[in->valnode->qoperand.length] = '\0';
+               state->curoperand += in->valnode->qoperand.length + 1;
                state->curitem++;
        }
        else
@@ -315,7 +315,7 @@ fillQT(QTN2QTState *state, QTNode *in)
 
                if (in->nchild == 2)
                {
-                       curitem->operator.left = state->curitem - curitem;
+                       curitem->qoperator.left = state->curitem - curitem;
                        fillQT(state, in->child[1]);
                }
        }
@@ -361,9 +361,9 @@ QTNCopy(QTNode *in)
 
        if (in->valnode->type == QI_VAL)
        {
-               out->word = palloc(in->valnode->operand.length + 1);
-               memcpy(out->word, in->word, in->valnode->operand.length);
-               out->word[in->valnode->operand.length] = '\0';
+               out->word = palloc(in->valnode->qoperand.length + 1);
+               memcpy(out->word, in->word, in->valnode->qoperand.length);
+               out->word[in->valnode->qoperand.length] = '\0';
                out->flags |= QTN_WORDFREE;
        }
        else
index 3dac5ce..65c7e6f 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/utils/adt/tsrank.c,v 1.15 2009/06/11 14:49:04 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/utils/adt/tsrank.c,v 1.16 2009/07/16 06:33:44 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -358,7 +358,7 @@ calc_rank(float *w, TSVector t, TSQuery q, int4 method)
                return 0.0;
 
        /* XXX: What about NOT? */
-       res = (item->type == QI_OPR && item->operator.oper == OP_AND) ?
+       res = (item->type == QI_OPR && item->qoperator.oper == OP_AND) ?
                calc_rank_and(w, t, q) : calc_rank_or(w, t, q);
 
        if (res < 0)
@@ -641,7 +641,7 @@ get_docrep(TSVector txt, QueryRepresentation *qr, int *doclen)
                if (item[i].type != QI_VAL)
                        continue;
 
-               curoperand = &item[i].operand;
+               curoperand = &item[i].qoperand;
 
                if (QR_GET_OPERAND_EXISTS(qr, &item[i]))
                        continue;
@@ -680,8 +680,8 @@ get_docrep(TSVector txt, QueryRepresentation *qr, int *doclen)
 
                                        for (k = 0; k < qr->query->size; k++)
                                        {
-                                               QueryOperand *kptr = &item[k].operand;
-                                               QueryOperand *iptr = &item[i].operand;
+                                               QueryOperand *kptr = &item[k].qoperand;
+                                               QueryOperand *iptr = &item[i].qoperand;
 
                                                if (k == i ||
                                                        (item[k].type == QI_VAL &&
index 093f2a3..6886ee4 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/utils/adt/tsvector_op.c,v 1.23 2009/06/11 14:49:04 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/utils/adt/tsvector_op.c,v 1.24 2009/07/16 06:33:44 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -668,7 +668,7 @@ TS_execute(QueryItem *curitem, void *checkval, bool calcnot,
        if (curitem->type == QI_VAL)
                return chkcond(checkval, (QueryOperand *) curitem);
 
-       switch (curitem->operator.oper)
+       switch (curitem->qoperator.oper)
        {
                case OP_NOT:
                        if (calcnot)
@@ -676,19 +676,19 @@ TS_execute(QueryItem *curitem, void *checkval, bool calcnot,
                        else
                                return true;
                case OP_AND:
-                       if (TS_execute(curitem + curitem->operator.left, checkval, calcnot, chkcond))
+                       if (TS_execute(curitem + curitem->qoperator.left, checkval, calcnot, chkcond))
                                return TS_execute(curitem + 1, checkval, calcnot, chkcond);
                        else
                                return false;
 
                case OP_OR:
-                       if (TS_execute(curitem + curitem->operator.left, checkval, calcnot, chkcond))
+                       if (TS_execute(curitem + curitem->qoperator.left, checkval, calcnot, chkcond))
                                return true;
                        else
                                return TS_execute(curitem + 1, checkval, calcnot, chkcond);
 
                default:
-                       elog(ERROR, "unrecognized operator: %d", curitem->operator.oper);
+                       elog(ERROR, "unrecognized operator: %d", curitem->qoperator.oper);
        }
 
        /* not reachable, but keep compiler quiet */
index 66fa781..2944249 100644 (file)
@@ -10,7 +10,7 @@
  * Written by Peter Eisentraut <peter_e@gmx.net>.
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.506 2009/07/12 17:12:34 tgl Exp $
+ *       $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.507 2009/07/16 06:33:44 petere Exp $
  *
  *--------------------------------------------------------------------
  */
@@ -5331,7 +5331,7 @@ flatten_set_variable_args(const char *name, List *args)
        {
                Node       *arg = (Node *) lfirst(l);
                char       *val;
-               TypeName   *typename = NULL;
+               TypeName   *typeName = NULL;
                A_Const    *con;
 
                if (l != list_head(args))
@@ -5342,7 +5342,7 @@ flatten_set_variable_args(const char *name, List *args)
                        TypeCast   *tc = (TypeCast *) arg;
 
                        arg = tc->arg;
-                       typename = tc->typename;
+                       typeName = tc->typeName;
                }
 
                if (!IsA(arg, A_Const))
@@ -5360,7 +5360,7 @@ flatten_set_variable_args(const char *name, List *args)
                                break;
                        case T_String:
                                val = strVal(&con->val);
-                               if (typename != NULL)
+                               if (typeName != NULL)
                                {
                                        /*
                                         * Must be a ConstInterval argument for TIME ZONE. Coerce
@@ -5372,7 +5372,7 @@ flatten_set_variable_args(const char *name, List *args)
                                        Datum           interval;
                                        char       *intervalout;
 
-                                       typoid = typenameTypeId(NULL, typename, &typmod);
+                                       typoid = typenameTypeId(NULL, typeName, &typmod);
                                        Assert(typoid == INTERVALOID);
 
                                        interval =
index 9b08df3..2bbac6f 100644 (file)
@@ -14,7 +14,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/utils/mmgr/mcxt.c,v 1.66 2009/01/01 17:23:53 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/utils/mmgr/mcxt.c,v 1.67 2009/07/16 06:33:44 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -193,7 +193,7 @@ MemoryContextDelete(MemoryContext context)
                        }
                }
        }
-       (*context->methods->delete) (context);
+       (*context->methods->delete_context) (context);
        pfree(context);
 }
 
index edfa864..24454ef 100644 (file)
@@ -8,7 +8,7 @@
  * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/include/catalog/pg_constraint.h,v 1.30 2009/01/01 17:23:56 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_constraint.h,v 1.31 2009/07/16 06:33:45 petere Exp $
  *
  * NOTES
  *       the genbki.sh script reads this file and generates .bki
@@ -210,7 +210,7 @@ extern void RenameConstraintById(Oid conId, const char *newname);
 extern bool ConstraintNameIsUsed(ConstraintCategory conCat, Oid objId,
                                         Oid objNamespace, const char *conname);
 extern char *ChooseConstraintName(const char *name1, const char *name2,
-                                        const char *label, Oid namespace,
+                                        const char *label, Oid namespaceid,
                                         List *others);
 
 extern void AlterConstraintNamespaces(Oid ownerId, Oid oldNspId,
index 4658a31..1d6ab7b 100644 (file)
@@ -7,7 +7,7 @@
  * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/include/commands/defrem.h,v 1.94 2009/04/04 21:12:31 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/commands/defrem.h,v 1.95 2009/07/16 06:33:45 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -41,7 +41,7 @@ extern void ReindexDatabase(const char *databaseName,
 extern char *makeObjectName(const char *name1, const char *name2,
                           const char *label);
 extern char *ChooseRelationName(const char *name1, const char *name2,
-                                  const char *label, Oid namespace);
+                                  const char *label, Oid namespaceid);
 extern Oid     GetDefaultOpClass(Oid type_id, Oid am_id);
 
 /* commands/functioncmds.c */
index 82c9813..f0cd530 100644 (file)
@@ -7,7 +7,7 @@
  * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/include/commands/tablecmds.h,v 1.43 2009/06/11 14:49:11 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/commands/tablecmds.h,v 1.44 2009/07/16 06:33:45 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -57,7 +57,7 @@ extern void find_composite_type_dependencies(Oid typeOid,
                                                                 const char *origTblName,
                                                                 const char *origTypeName);
 
-extern AttrNumber *varattnos_map(TupleDesc old, TupleDesc new);
+extern AttrNumber *varattnos_map(TupleDesc olddesc, TupleDesc newdesc);
 extern AttrNumber *varattnos_map_schema(TupleDesc old, List *schema);
 extern void change_varattnos_of_a_node(Node *node, const AttrNumber *newattno);
 
index c8f3e42..f24834b 100644 (file)
@@ -7,7 +7,7 @@
  * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/include/nodes/makefuncs.h,v 1.68 2009/06/11 14:49:11 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/nodes/makefuncs.h,v 1.69 2009/07/16 06:33:45 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -60,13 +60,13 @@ extern RangeVar *makeRangeVar(char *schemaname, char *relname, int location);
 
 extern TypeName *makeTypeName(char *typnam);
 extern TypeName *makeTypeNameFromNameList(List *names);
-extern TypeName *makeTypeNameFromOid(Oid typeid, int32 typmod);
+extern TypeName *makeTypeNameFromOid(Oid typeOid, int32 typmod);
 
 extern FuncExpr *makeFuncExpr(Oid funcid, Oid rettype,
                         List *args, CoercionForm fformat);
 
 extern DefElem *makeDefElem(char *name, Node *arg);
-extern DefElem *makeDefElemExtended(char *namespace, char *name, Node *arg,
+extern DefElem *makeDefElemExtended(char *nameSpace, char *name, Node *arg,
                                        DefElemAction defaction);
 
 #endif   /* MAKEFUNC_H */
index c49c023..61d2750 100644 (file)
@@ -7,7 +7,7 @@
  * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/include/nodes/memnodes.h,v 1.35 2009/01/01 17:24:00 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/nodes/memnodes.h,v 1.36 2009/07/16 06:33:45 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -41,7 +41,7 @@ typedef struct MemoryContextMethods
        void       *(*realloc) (MemoryContext context, void *pointer, Size size);
        void            (*init) (MemoryContext context);
        void            (*reset) (MemoryContext context);
-       void            (*delete) (MemoryContext context);
+       void            (*delete_context) (MemoryContext context);
        Size            (*get_chunk_space) (MemoryContext context, void *pointer);
        bool            (*is_empty) (MemoryContext context);
        void            (*stats) (MemoryContext context, int level);
index 7793f66..ecd76d7 100644 (file)
@@ -13,7 +13,7 @@
  * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.395 2009/06/18 01:27:02 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.396 2009/07/16 06:33:45 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -161,7 +161,7 @@ typedef struct Query
  *
  * For TypeName structures generated internally, it is often easier to
  * specify the type by OID than by name.  If "names" is NIL then the
- * actual type OID is given by typeid, otherwise typeid is unused.
+ * actual type OID is given by typeOid, otherwise typeOid is unused.
  * Similarly, if "typmods" is NIL then the actual typmod is expected to
  * be prespecified in typemod, otherwise typemod is unused.
  *
@@ -173,7 +173,7 @@ typedef struct TypeName
 {
        NodeTag         type;
        List       *names;                      /* qualified name (list of Value strings) */
-       Oid                     typeid;                 /* type identified by OID */
+       Oid                     typeOid;                /* type identified by OID */
        bool            setof;                  /* is a set? */
        bool            pct_type;               /* %TYPE specified? */
        List       *typmods;            /* type modifier expression(s) */
@@ -256,7 +256,7 @@ typedef struct TypeCast
 {
        NodeTag         type;
        Node       *arg;                        /* the expression being casted */
-       TypeName   *typename;           /* the target type */
+       TypeName   *typeName;           /* the target type */
        int                     location;               /* token location, or -1 if unknown */
 } TypeCast;
 
@@ -457,7 +457,7 @@ typedef struct ColumnDef
 {
        NodeTag         type;
        char       *colname;            /* name of column */
-       TypeName   *typename;           /* type of column */
+       TypeName   *typeName;           /* type of column */
        int                     inhcount;               /* number of times column is inherited */
        bool            is_local;               /* column has local (non-inherited) def'n */
        bool            is_not_null;    /* NOT NULL constraint specified? */
@@ -554,7 +554,7 @@ typedef struct XmlSerialize
        NodeTag         type;
        XmlOptionType xmloption;        /* DOCUMENT or CONTENT */
        Node       *expr;
-       TypeName   *typename;
+       TypeName   *typeName;
        int                     location;               /* token location, or -1 if unknown */
 } XmlSerialize;
 
@@ -1166,7 +1166,7 @@ typedef struct AlterDomainStmt
                                                                 *      X = drop constraint
                                                                 *------------
                                                                 */
-       List       *typename;           /* domain to work on */
+       List       *typeName;           /* domain to work on */
        char       *name;                       /* column or constraint name to act on */
        Node       *def;                        /* definition of default or constraint */
        DropBehavior behavior;          /* RESTRICT or CASCADE for DROP cases */
@@ -1670,7 +1670,7 @@ typedef struct CreateDomainStmt
 {
        NodeTag         type;
        List       *domainname;         /* qualified name (list of Value strings) */
-       TypeName   *typename;           /* the base type */
+       TypeName   *typeName;           /* the base type */
        List       *constraints;        /* constraints (list of Constraint nodes) */
 } CreateDomainStmt;
 
@@ -2084,7 +2084,7 @@ typedef struct CompositeTypeStmt
 typedef struct CreateEnumStmt
 {
        NodeTag         type;
-       List       *typename;           /* qualified name (list of Value strings) */
+       List       *typeName;           /* qualified name (list of Value strings) */
        List       *vals;                       /* enum values (list of Value strings) */
 } CreateEnumStmt;
 
index a41b0e2..5f5d412 100644 (file)
@@ -10,7 +10,7 @@
  * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/include/nodes/primnodes.h,v 1.149 2009/06/11 14:49:11 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/nodes/primnodes.h,v 1.150 2009/07/16 06:33:45 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -1125,8 +1125,8 @@ typedef struct RangeTblRef
 /*----------
  * JoinExpr - for SQL JOIN expressions
  *
- * isNatural, using, and quals are interdependent.     The user can write only
- * one of NATURAL, USING(), or ON() (this is enforced by the grammar).
+ * isNatural, usingClause, and quals are interdependent.  The user can write
+ * only one of NATURAL, USING(), or ON() (this is enforced by the grammar).
  * If he writes NATURAL then parse analysis generates the equivalent USING()
  * list, and from that fills in "quals" with the right equality comparisons.
  * If he writes USING() then "quals" is filled with equality comparisons.
@@ -1152,7 +1152,7 @@ typedef struct JoinExpr
        bool            isNatural;              /* Natural join? Will need to shape table */
        Node       *larg;                       /* left subtree */
        Node       *rarg;                       /* right subtree */
-       List       *using;                      /* USING clause, if any (list of String) */
+       List       *usingClause;        /* USING clause, if any (list of String) */
        Node       *quals;                      /* qualifiers on join, if any */
        Alias      *alias;                      /* user-written alias clause, if any */
        int                     rtindex;                /* RT index assigned for join, or 0 */
index c829ac1..00da7d3 100644 (file)
@@ -7,7 +7,7 @@
  * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/include/optimizer/plancat.h,v 1.54 2009/06/11 14:49:11 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/optimizer/plancat.h,v 1.55 2009/07/16 06:33:45 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -39,12 +39,12 @@ extern List *build_physical_tlist(PlannerInfo *root, RelOptInfo *rel);
 extern bool has_unique_index(RelOptInfo *rel, AttrNumber attno);
 
 extern Selectivity restriction_selectivity(PlannerInfo *root,
-                                               Oid operator,
+                                               Oid operatorid,
                                                List *args,
                                                int varRelid);
 
 extern Selectivity join_selectivity(PlannerInfo *root,
-                                Oid operator,
+                                Oid operatorid,
                                 List *args,
                                 JoinType jointype,
                                 SpecialJoinInfo *sjinfo);
index 26d74a1..c2b2b51 100644 (file)
@@ -6,7 +6,7 @@
  * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/include/parser/parse_type.h,v 1.40 2009/01/01 17:24:00 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/parser/parse_type.h,v 1.41 2009/07/16 06:33:45 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
 
 typedef HeapTuple Type;
 
-extern Type LookupTypeName(ParseState *pstate, const TypeName *typename,
+extern Type LookupTypeName(ParseState *pstate, const TypeName *typeName,
                           int32 *typmod_p);
-extern Type typenameType(ParseState *pstate, const TypeName *typename,
+extern Type typenameType(ParseState *pstate, const TypeName *typeName,
                         int32 *typmod_p);
-extern Oid typenameTypeId(ParseState *pstate, const TypeName *typename,
+extern Oid typenameTypeId(ParseState *pstate, const TypeName *typeName,
                           int32 *typmod_p);
 
-extern char *TypeNameToString(const TypeName *typename);
+extern char *TypeNameToString(const TypeName *typeName);
 extern char *TypeNameListToString(List *typenames);
 
 extern Type typeidType(Oid id);
index 253fa14..61a3d22 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Copyright (c) 1998-2009, PostgreSQL Global Development Group
  *
- * $PostgreSQL: pgsql/src/include/tsearch/ts_public.h,v 1.14 2009/06/11 14:49:12 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/tsearch/ts_public.h,v 1.15 2009/07/16 06:33:45 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -111,7 +111,7 @@ typedef struct
        bool            isend;                  /* in: marks for lexize_info about text end is
                                                                 * reached */
        bool            getnext;                /* out: dict wants next lexeme */
-       void       *private;            /* internal dict state between calls with
+       void       *private_state;      /* internal dict state between calls with
                                                                 * getnext == true */
 } DictSubState;
 
index 60c1655..6036110 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Copyright (c) 1998-2009, PostgreSQL Global Development Group
  *
- * $PostgreSQL: pgsql/src/include/tsearch/ts_type.h,v 1.15 2009/01/01 17:24:01 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/tsearch/ts_type.h,v 1.16 2009/07/16 06:33:45 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -218,8 +218,8 @@ typedef struct
 typedef union
 {
        QueryItemType type;
-       QueryOperator operator;
-       QueryOperand operand;
+       QueryOperator qoperator;
+       QueryOperand qoperand;
 } QueryItem;
 
 /*
index 566227e..db9a43b 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Copyright (c) 1998-2009, PostgreSQL Global Development Group
  *
- * $PostgreSQL: pgsql/src/include/tsearch/ts_utils.h,v 1.17 2009/06/11 14:49:12 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/tsearch/ts_utils.h,v 1.18 2009/07/16 06:33:46 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -55,7 +55,7 @@ extern TSQuery parse_tsquery(char *buf,
 extern void pushValue(TSQueryParserState state,
                  char *strval, int lenval, int2 weight, bool prefix);
 extern void pushStop(TSQueryParserState state);
-extern void pushOperator(TSQueryParserState state, int8 operator);
+extern void pushOperator(TSQueryParserState state, int8 oper);
 
 /*
  * parse plain text and lexize words
index de9adb8..5547b6c 100644 (file)
@@ -7,7 +7,7 @@
  * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/include/utils/builtins.h,v 1.333 2009/07/07 18:23:15 petere Exp $
+ * $PostgreSQL: pgsql/src/include/utils/builtins.h,v 1.334 2009/07/16 06:33:46 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -593,7 +593,7 @@ extern List *deparse_context_for(const char *aliasname, Oid relid);
 extern List *deparse_context_for_plan(Node *plan, Node *outer_plan,
                                                 List *rtable, List *subplans);
 extern const char *quote_identifier(const char *ident);
-extern char *quote_qualified_identifier(const char *namespace,
+extern char *quote_qualified_identifier(const char *qualifier,
                                                   const char *ident);
 
 /* tid.c */
diff --git a/src/tools/pginclude/cpluspluscheck b/src/tools/pginclude/cpluspluscheck
new file mode 100644 (file)
index 0000000..f266fea
--- /dev/null
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+# Check all include files in or below the current directory for C++
+# compatibility.  Typically, run this in PostgreSQL's src/include/ directory.
+# No output if everything is OK, else compiler errors.
+
+set -e
+
+me=`basename $0`
+
+trap 'rm -rf $tmp' 0 1 2 3 15
+tmp=`mktemp -d /tmp/$me.XXXXXX`
+
+{
+echo ' extern "C" {'
+echo '#include "postgres.h"'
+
+# Omit port/, because it's platform specific, and c.h includes it anyway. Omit
+# regex/ and snowball/, because those files came from elsewhere, and they would
+# need extra work if someone cared to fix them.  kwlist.h is not meant to be
+# included directly.  rusagestub.h will be included by ./utils/pg_rusage.h if
+# necessary.
+for file in `find . \( -name port -prune -o -name regex -prune -o -name snowball -prune \) -o -name '*.h' -not -name kwlist.h -not -name rusagestub.h -print`; do
+       f=`echo $file | sed 's,^\./,,'`
+       echo "#include \"$f\""
+done
+
+echo '};'
+} >$tmp/test.cpp
+
+# -fno-operator-names omits the definition of bitand and bitor, which would
+# collide with varbit.h.  Could be fixed, if one were so inclined.
+${CXX:-g++} -I. -fsyntax-only -fno-operator-names -Wall -c $tmp/test.cpp