Make backend header files C++ safe

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.
This commit is contained in:
Peter Eisentraut 2009-07-16 06:33:46 +00:00
parent 4ef8dc7a75
commit de160e2c00
52 changed files with 392 additions and 359 deletions

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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 * NOTES
* some of the executor utility code such as "ExecTypeFromTL" should be * some of the executor utility code such as "ExecTypeFromTL" should be
@ -538,10 +538,10 @@ BuildDescForRelation(List *schema)
attnum++; attnum++;
attname = entry->colname; attname = entry->colname;
atttypid = typenameTypeId(NULL, entry->typename, &atttypmod); atttypid = typenameTypeId(NULL, entry->typeName, &atttypmod);
attdim = list_length(entry->typename->arrayBounds); attdim = list_length(entry->typeName->arrayBounds);
if (entry->typename->setof) if (entry->typeName->setof)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_INVALID_TABLE_DEFINITION), (errcode(ERRCODE_INVALID_TABLE_DEFINITION),
errmsg("column \"%s\" cannot be declared SETOF", errmsg("column \"%s\" cannot be declared SETOF",

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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 * char *
ChooseConstraintName(const char *name1, const char *name2, ChooseConstraintName(const char *name1, const char *name2,
const char *label, Oid namespace, const char *label, Oid namespaceid,
List *others) List *others)
{ {
int pass = 0; int pass = 0;
@ -461,7 +461,7 @@ ChooseConstraintName(const char *name1, const char *name2,
ScanKeyInit(&skey[1], ScanKeyInit(&skey[1],
Anum_pg_constraint_connamespace, Anum_pg_constraint_connamespace,
BTEqualStrategyNumber, F_OIDEQ, BTEqualStrategyNumber, F_OIDEQ,
ObjectIdGetDatum(namespace)); ObjectIdGetDatum(namespaceid));
conscan = systable_beginscan(conDesc, ConstraintNameNspIndexId, true, conscan = systable_beginscan(conDesc, ConstraintNameNspIndexId, true,
SnapshotNow, 2, skey); SnapshotNow, 2, skey);

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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 * char *
ChooseRelationName(const char *name1, const char *name2, ChooseRelationName(const char *name1, const char *name2,
const char *label, Oid namespace) const char *label, Oid namespaceid)
{ {
int pass = 0; int pass = 0;
char *relname = NULL; char *relname = NULL;
@ -1250,7 +1250,7 @@ ChooseRelationName(const char *name1, const char *name2,
{ {
relname = makeObjectName(name1, name2, modlabel); relname = makeObjectName(name1, name2, modlabel);
if (!OidIsValid(get_relname_relid(relname, namespace))) if (!OidIsValid(get_relname_relid(relname, namespaceid)))
break; break;
/* found a conflict, so try a new name component */ /* found a conflict, so try a new name component */

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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) switch (i)
{ {
case SEQ_COL_NAME: case SEQ_COL_NAME:
coldef->typename = makeTypeNameFromOid(NAMEOID, -1); coldef->typeName = makeTypeNameFromOid(NAMEOID, -1);
coldef->colname = "sequence_name"; coldef->colname = "sequence_name";
namestrcpy(&name, seq->sequence->relname); namestrcpy(&name, seq->sequence->relname);
value[i - 1] = NameGetDatum(&name); value[i - 1] = NameGetDatum(&name);
break; break;
case SEQ_COL_LASTVAL: case SEQ_COL_LASTVAL:
coldef->typename = makeTypeNameFromOid(INT8OID, -1); coldef->typeName = makeTypeNameFromOid(INT8OID, -1);
coldef->colname = "last_value"; coldef->colname = "last_value";
value[i - 1] = Int64GetDatumFast(new.last_value); value[i - 1] = Int64GetDatumFast(new.last_value);
break; break;
case SEQ_COL_STARTVAL: case SEQ_COL_STARTVAL:
coldef->typename = makeTypeNameFromOid(INT8OID, -1); coldef->typeName = makeTypeNameFromOid(INT8OID, -1);
coldef->colname = "start_value"; coldef->colname = "start_value";
value[i - 1] = Int64GetDatumFast(new.start_value); value[i - 1] = Int64GetDatumFast(new.start_value);
break; break;
case SEQ_COL_INCBY: case SEQ_COL_INCBY:
coldef->typename = makeTypeNameFromOid(INT8OID, -1); coldef->typeName = makeTypeNameFromOid(INT8OID, -1);
coldef->colname = "increment_by"; coldef->colname = "increment_by";
value[i - 1] = Int64GetDatumFast(new.increment_by); value[i - 1] = Int64GetDatumFast(new.increment_by);
break; break;
case SEQ_COL_MAXVALUE: case SEQ_COL_MAXVALUE:
coldef->typename = makeTypeNameFromOid(INT8OID, -1); coldef->typeName = makeTypeNameFromOid(INT8OID, -1);
coldef->colname = "max_value"; coldef->colname = "max_value";
value[i - 1] = Int64GetDatumFast(new.max_value); value[i - 1] = Int64GetDatumFast(new.max_value);
break; break;
case SEQ_COL_MINVALUE: case SEQ_COL_MINVALUE:
coldef->typename = makeTypeNameFromOid(INT8OID, -1); coldef->typeName = makeTypeNameFromOid(INT8OID, -1);
coldef->colname = "min_value"; coldef->colname = "min_value";
value[i - 1] = Int64GetDatumFast(new.min_value); value[i - 1] = Int64GetDatumFast(new.min_value);
break; break;
case SEQ_COL_CACHE: case SEQ_COL_CACHE:
coldef->typename = makeTypeNameFromOid(INT8OID, -1); coldef->typeName = makeTypeNameFromOid(INT8OID, -1);
coldef->colname = "cache_value"; coldef->colname = "cache_value";
value[i - 1] = Int64GetDatumFast(new.cache_value); value[i - 1] = Int64GetDatumFast(new.cache_value);
break; break;
case SEQ_COL_LOG: case SEQ_COL_LOG:
coldef->typename = makeTypeNameFromOid(INT8OID, -1); coldef->typeName = makeTypeNameFromOid(INT8OID, -1);
coldef->colname = "log_cnt"; coldef->colname = "log_cnt";
value[i - 1] = Int64GetDatum((int64) 1); value[i - 1] = Int64GetDatum((int64) 1);
break; break;
case SEQ_COL_CYCLE: case SEQ_COL_CYCLE:
coldef->typename = makeTypeNameFromOid(BOOLOID, -1); coldef->typeName = makeTypeNameFromOid(BOOLOID, -1);
coldef->colname = "is_cycled"; coldef->colname = "is_cycled";
value[i - 1] = BoolGetDatum(new.is_cycled); value[i - 1] = BoolGetDatum(new.is_cycled);
break; break;
case SEQ_COL_CALLED: case SEQ_COL_CALLED:
coldef->typename = makeTypeNameFromOid(BOOLOID, -1); coldef->typeName = makeTypeNameFromOid(BOOLOID, -1);
coldef->colname = "is_called"; coldef->colname = "is_called";
value[i - 1] = BoolGetDatum(false); value[i - 1] = BoolGetDatum(false);
break; break;

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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, bool recurse, bool recursing,
AlterTableCmd *cmd); AlterTableCmd *cmd);
static void ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel, 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 ATPostAlterTypeCleanup(List **wqueue, AlteredTableInfo *tab);
static void ATPostAlterTypeParse(char *cmd, List **wqueue); static void ATPostAlterTypeParse(char *cmd, List **wqueue);
static void change_owner_recurse_to_sequences(Oid relationOid, 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\"", (errmsg("merging multiple inherited definitions of column \"%s\"",
attributeName))); attributeName)));
def = (ColumnDef *) list_nth(inhSchema, exist_attno - 1); def = (ColumnDef *) list_nth(inhSchema, exist_attno - 1);
defTypeId = typenameTypeId(NULL, def->typename, &deftypmod); defTypeId = typenameTypeId(NULL, def->typeName, &deftypmod);
if (defTypeId != attribute->atttypid || if (defTypeId != attribute->atttypid ||
deftypmod != attribute->atttypmod) deftypmod != attribute->atttypmod)
ereport(ERROR, ereport(ERROR,
@ -1288,7 +1288,7 @@ MergeAttributes(List *schema, List *supers, bool istemp,
errmsg("inherited column \"%s\" has a type conflict", errmsg("inherited column \"%s\" has a type conflict",
attributeName), attributeName),
errdetail("%s versus %s", errdetail("%s versus %s",
TypeNameToString(def->typename), TypeNameToString(def->typeName),
format_type_be(attribute->atttypid)))); format_type_be(attribute->atttypid))));
def->inhcount++; def->inhcount++;
/* Merge of NOT NULL constraints = OR 'em together */ /* Merge of NOT NULL constraints = OR 'em together */
@ -1303,7 +1303,7 @@ MergeAttributes(List *schema, List *supers, bool istemp,
*/ */
def = makeNode(ColumnDef); def = makeNode(ColumnDef);
def->colname = pstrdup(attributeName); def->colname = pstrdup(attributeName);
def->typename = makeTypeNameFromOid(attribute->atttypid, def->typeName = makeTypeNameFromOid(attribute->atttypid,
attribute->atttypmod); attribute->atttypmod);
def->inhcount = 1; def->inhcount = 1;
def->is_local = false; def->is_local = false;
@ -1438,16 +1438,16 @@ MergeAttributes(List *schema, List *supers, bool istemp,
(errmsg("merging column \"%s\" with inherited definition", (errmsg("merging column \"%s\" with inherited definition",
attributeName))); attributeName)));
def = (ColumnDef *) list_nth(inhSchema, exist_attno - 1); def = (ColumnDef *) list_nth(inhSchema, exist_attno - 1);
defTypeId = typenameTypeId(NULL, def->typename, &deftypmod); defTypeId = typenameTypeId(NULL, def->typeName, &deftypmod);
newTypeId = typenameTypeId(NULL, newdef->typename, &newtypmod); newTypeId = typenameTypeId(NULL, newdef->typeName, &newtypmod);
if (defTypeId != newTypeId || deftypmod != newtypmod) if (defTypeId != newTypeId || deftypmod != newtypmod)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_DATATYPE_MISMATCH), (errcode(ERRCODE_DATATYPE_MISMATCH),
errmsg("column \"%s\" has a type conflict", errmsg("column \"%s\" has a type conflict",
attributeName), attributeName),
errdetail("%s versus %s", errdetail("%s versus %s",
TypeNameToString(def->typename), TypeNameToString(def->typeName),
TypeNameToString(newdef->typename)))); TypeNameToString(newdef->typeName))));
/* Mark the column as locally defined */ /* Mark the column as locally defined */
def->is_local = true; def->is_local = true;
/* Merge of NOT NULL constraints = OR 'em together */ /* 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. * matching according to column name.
*/ */
AttrNumber * AttrNumber *
varattnos_map(TupleDesc old, TupleDesc new) varattnos_map(TupleDesc olddesc, TupleDesc newdesc)
{ {
AttrNumber *attmap; AttrNumber *attmap;
int i, int i,
j; j;
attmap = (AttrNumber *) palloc0(sizeof(AttrNumber) * old->natts); attmap = (AttrNumber *) palloc0(sizeof(AttrNumber) * olddesc->natts);
for (i = 1; i <= old->natts; i++) 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 */ 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), if (strcmp(NameStr(olddesc->attrs[i - 1]->attname),
NameStr(new->attrs[j - 1]->attname)) == 0) NameStr(newdesc->attrs[j - 1]->attname)) == 0)
{ {
attmap[i - 1] = j; attmap[i - 1] = j;
break; break;
@ -3530,7 +3530,7 @@ ATExecAddColumn(AlteredTableInfo *tab, Relation rel,
int32 ctypmod; int32 ctypmod;
/* Child column must match by type */ /* Child column must match by type */
ctypeId = typenameTypeId(NULL, colDef->typename, &ctypmod); ctypeId = typenameTypeId(NULL, colDef->typeName, &ctypmod);
if (ctypeId != childatt->atttypid || if (ctypeId != childatt->atttypid ||
ctypmod != childatt->atttypmod) ctypmod != childatt->atttypmod)
ereport(ERROR, ereport(ERROR,
@ -3597,7 +3597,7 @@ ATExecAddColumn(AlteredTableInfo *tab, Relation rel,
MaxHeapAttributeNumber))); MaxHeapAttributeNumber)));
} }
typeTuple = typenameType(NULL, colDef->typename, &typmod); typeTuple = typenameType(NULL, colDef->typeName, &typmod);
tform = (Form_pg_type) GETSTRUCT(typeTuple); tform = (Form_pg_type) GETSTRUCT(typeTuple);
typeOid = HeapTupleGetOid(typeTuple); typeOid = HeapTupleGetOid(typeTuple);
@ -3614,7 +3614,7 @@ ATExecAddColumn(AlteredTableInfo *tab, Relation rel,
attribute.atttypmod = typmod; attribute.atttypmod = typmod;
attribute.attnum = newattnum; attribute.attnum = newattnum;
attribute.attbyval = tform->typbyval; attribute.attbyval = tform->typbyval;
attribute.attndims = list_length(colDef->typename->arrayBounds); attribute.attndims = list_length(colDef->typeName->arrayBounds);
attribute.attstorage = tform->typstorage; attribute.attstorage = tform->typstorage;
attribute.attalign = tform->typalign; attribute.attalign = tform->typalign;
attribute.attnotnull = colDef->is_not_null; attribute.attnotnull = colDef->is_not_null;
@ -3788,7 +3788,7 @@ ATPrepAddOids(List **wqueue, Relation rel, bool recurse, AlterTableCmd *cmd)
ColumnDef *cdef = makeNode(ColumnDef); ColumnDef *cdef = makeNode(ColumnDef);
cdef->colname = pstrdup("oid"); cdef->colname = pstrdup("oid");
cdef->typename = makeTypeNameFromOid(OIDOID, -1); cdef->typeName = makeTypeNameFromOid(OIDOID, -1);
cdef->inhcount = 0; cdef->inhcount = 0;
cdef->is_local = true; cdef->is_local = true;
cdef->is_not_null = true; cdef->is_not_null = true;
@ -5548,7 +5548,7 @@ ATPrepAlterColumnType(List **wqueue,
AlterTableCmd *cmd) AlterTableCmd *cmd)
{ {
char *colName = cmd->name; char *colName = cmd->name;
TypeName *typename = (TypeName *) cmd->def; TypeName *typeName = (TypeName *) cmd->def;
HeapTuple tuple; HeapTuple tuple;
Form_pg_attribute attTup; Form_pg_attribute attTup;
AttrNumber attnum; AttrNumber attnum;
@ -5583,7 +5583,7 @@ ATPrepAlterColumnType(List **wqueue,
colName))); colName)));
/* Look up the target type */ /* Look up the target type */
targettype = typenameTypeId(NULL, typename, &targettypmod); targettype = typenameTypeId(NULL, typeName, &targettypmod);
/* make sure datatype is legal for a column */ /* make sure datatype is legal for a column */
CheckAttributeType(colName, targettype); CheckAttributeType(colName, targettype);
@ -5678,7 +5678,7 @@ ATPrepAlterColumnType(List **wqueue,
static void static void
ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel, ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
const char *colName, TypeName *typename) const char *colName, TypeName *typeName)
{ {
HeapTuple heapTup; HeapTuple heapTup;
Form_pg_attribute attTup; Form_pg_attribute attTup;
@ -5715,7 +5715,7 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
colName))); colName)));
/* Look up the target type (should not fail, since prep found it) */ /* 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); tform = (Form_pg_type) GETSTRUCT(typeTuple);
targettype = HeapTupleGetOid(typeTuple); targettype = HeapTupleGetOid(typeTuple);
@ -5962,7 +5962,7 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
*/ */
attTup->atttypid = targettype; attTup->atttypid = targettype;
attTup->atttypmod = targettypmod; attTup->atttypmod = targettypmod;
attTup->attndims = list_length(typename->arrayBounds); attTup->attndims = list_length(typeName->arrayBounds);
attTup->attlen = tform->typlen; attTup->attlen = tform->typlen;
attTup->attbyval = tform->typbyval; attTup->attbyval = tform->typbyval;
attTup->attalign = tform->typalign; attTup->attalign = tform->typalign;

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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 * DESCRIPTION
* The "DefineFoo" routines take the parse tree and pick out the * The "DefineFoo" routines take the parse tree and pick out the
@ -759,7 +759,7 @@ DefineDomain(CreateDomainStmt *stmt)
bool saw_default = false; bool saw_default = false;
bool typNotNull = false; bool typNotNull = false;
bool nullDefined = false; bool nullDefined = false;
int32 typNDims = list_length(stmt->typename->arrayBounds); int32 typNDims = list_length(stmt->typeName->arrayBounds);
HeapTuple typeTup; HeapTuple typeTup;
List *schema = stmt->constraints; List *schema = stmt->constraints;
ListCell *listptr; ListCell *listptr;
@ -799,7 +799,7 @@ DefineDomain(CreateDomainStmt *stmt)
/* /*
* Look up the base type. * Look up the base type.
*/ */
typeTup = typenameType(NULL, stmt->typename, &basetypeMod); typeTup = typenameType(NULL, stmt->typeName, &basetypeMod);
baseType = (Form_pg_type) GETSTRUCT(typeTup); baseType = (Form_pg_type) GETSTRUCT(typeTup);
basetypeoid = HeapTupleGetOid(typeTup); basetypeoid = HeapTupleGetOid(typeTup);
@ -815,7 +815,7 @@ DefineDomain(CreateDomainStmt *stmt)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_DATATYPE_MISMATCH), (errcode(ERRCODE_DATATYPE_MISMATCH),
errmsg("\"%s\" is not a valid base type for a domain", errmsg("\"%s\" is not a valid base type for a domain",
TypeNameToString(stmt->typename)))); TypeNameToString(stmt->typeName))));
/* passed by value */ /* passed by value */
byValue = baseType->typbyval; byValue = baseType->typbyval;
@ -1097,7 +1097,7 @@ DefineEnum(CreateEnumStmt *stmt)
Relation pg_type; Relation pg_type;
/* Convert list of names to a name and namespace */ /* Convert list of names to a name and namespace */
enumNamespace = QualifiedNameGetCreationNamespace(stmt->typename, enumNamespace = QualifiedNameGetCreationNamespace(stmt->typeName,
&enumName); &enumName);
/* Check we have creation rights in target namespace */ /* Check we have creation rights in target namespace */

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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); ColumnDef *def = makeNode(ColumnDef);
def->colname = pstrdup(tle->resname); def->colname = pstrdup(tle->resname);
def->typename = makeTypeNameFromOid(exprType((Node *) tle->expr), def->typeName = makeTypeNameFromOid(exprType((Node *) tle->expr),
exprTypmod((Node *) tle->expr)); exprTypmod((Node *) tle->expr));
def->inhcount = 0; def->inhcount = 0;
def->is_local = true; def->is_local = true;

View File

@ -15,7 +15,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * 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_SCALAR_FIELD(isNatural);
COPY_NODE_FIELD(larg); COPY_NODE_FIELD(larg);
COPY_NODE_FIELD(rarg); COPY_NODE_FIELD(rarg);
COPY_NODE_FIELD(using); COPY_NODE_FIELD(usingClause);
COPY_NODE_FIELD(quals); COPY_NODE_FIELD(quals);
COPY_NODE_FIELD(alias); COPY_NODE_FIELD(alias);
COPY_SCALAR_FIELD(rtindex); COPY_SCALAR_FIELD(rtindex);
@ -1973,7 +1973,7 @@ _copyTypeName(TypeName *from)
TypeName *newnode = makeNode(TypeName); TypeName *newnode = makeNode(TypeName);
COPY_NODE_FIELD(names); COPY_NODE_FIELD(names);
COPY_SCALAR_FIELD(typeid); COPY_SCALAR_FIELD(typeOid);
COPY_SCALAR_FIELD(setof); COPY_SCALAR_FIELD(setof);
COPY_SCALAR_FIELD(pct_type); COPY_SCALAR_FIELD(pct_type);
COPY_NODE_FIELD(typmods); COPY_NODE_FIELD(typmods);
@ -2042,7 +2042,7 @@ _copyTypeCast(TypeCast *from)
TypeCast *newnode = makeNode(TypeCast); TypeCast *newnode = makeNode(TypeCast);
COPY_NODE_FIELD(arg); COPY_NODE_FIELD(arg);
COPY_NODE_FIELD(typename); COPY_NODE_FIELD(typeName);
COPY_LOCATION_FIELD(location); COPY_LOCATION_FIELD(location);
return newnode; return newnode;
@ -2068,7 +2068,7 @@ _copyColumnDef(ColumnDef *from)
ColumnDef *newnode = makeNode(ColumnDef); ColumnDef *newnode = makeNode(ColumnDef);
COPY_STRING_FIELD(colname); COPY_STRING_FIELD(colname);
COPY_NODE_FIELD(typename); COPY_NODE_FIELD(typeName);
COPY_SCALAR_FIELD(inhcount); COPY_SCALAR_FIELD(inhcount);
COPY_SCALAR_FIELD(is_local); COPY_SCALAR_FIELD(is_local);
COPY_SCALAR_FIELD(is_not_null); COPY_SCALAR_FIELD(is_not_null);
@ -2127,7 +2127,7 @@ _copyXmlSerialize(XmlSerialize *from)
COPY_SCALAR_FIELD(xmloption); COPY_SCALAR_FIELD(xmloption);
COPY_NODE_FIELD(expr); COPY_NODE_FIELD(expr);
COPY_NODE_FIELD(typename); COPY_NODE_FIELD(typeName);
COPY_LOCATION_FIELD(location); COPY_LOCATION_FIELD(location);
return newnode; return newnode;
@ -2282,7 +2282,7 @@ _copyAlterDomainStmt(AlterDomainStmt *from)
AlterDomainStmt *newnode = makeNode(AlterDomainStmt); AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
COPY_SCALAR_FIELD(subtype); COPY_SCALAR_FIELD(subtype);
COPY_NODE_FIELD(typename); COPY_NODE_FIELD(typeName);
COPY_STRING_FIELD(name); COPY_STRING_FIELD(name);
COPY_NODE_FIELD(def); COPY_NODE_FIELD(def);
COPY_SCALAR_FIELD(behavior); COPY_SCALAR_FIELD(behavior);
@ -2712,7 +2712,7 @@ _copyCreateEnumStmt(CreateEnumStmt *from)
{ {
CreateEnumStmt *newnode = makeNode(CreateEnumStmt); CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
COPY_NODE_FIELD(typename); COPY_NODE_FIELD(typeName);
COPY_NODE_FIELD(vals); COPY_NODE_FIELD(vals);
return newnode; return newnode;
@ -2747,7 +2747,7 @@ _copyCreateDomainStmt(CreateDomainStmt *from)
CreateDomainStmt *newnode = makeNode(CreateDomainStmt); CreateDomainStmt *newnode = makeNode(CreateDomainStmt);
COPY_NODE_FIELD(domainname); COPY_NODE_FIELD(domainname);
COPY_NODE_FIELD(typename); COPY_NODE_FIELD(typeName);
COPY_NODE_FIELD(constraints); COPY_NODE_FIELD(constraints);
return newnode; return newnode;

View File

@ -22,7 +22,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * 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_SCALAR_FIELD(isNatural);
COMPARE_NODE_FIELD(larg); COMPARE_NODE_FIELD(larg);
COMPARE_NODE_FIELD(rarg); COMPARE_NODE_FIELD(rarg);
COMPARE_NODE_FIELD(using); COMPARE_NODE_FIELD(usingClause);
COMPARE_NODE_FIELD(quals); COMPARE_NODE_FIELD(quals);
COMPARE_NODE_FIELD(alias); COMPARE_NODE_FIELD(alias);
COMPARE_SCALAR_FIELD(rtindex); COMPARE_SCALAR_FIELD(rtindex);
@ -966,7 +966,7 @@ static bool
_equalAlterDomainStmt(AlterDomainStmt *a, AlterDomainStmt *b) _equalAlterDomainStmt(AlterDomainStmt *a, AlterDomainStmt *b)
{ {
COMPARE_SCALAR_FIELD(subtype); COMPARE_SCALAR_FIELD(subtype);
COMPARE_NODE_FIELD(typename); COMPARE_NODE_FIELD(typeName);
COMPARE_STRING_FIELD(name); COMPARE_STRING_FIELD(name);
COMPARE_NODE_FIELD(def); COMPARE_NODE_FIELD(def);
COMPARE_SCALAR_FIELD(behavior); COMPARE_SCALAR_FIELD(behavior);
@ -1330,7 +1330,7 @@ _equalCompositeTypeStmt(CompositeTypeStmt *a, CompositeTypeStmt *b)
static bool static bool
_equalCreateEnumStmt(CreateEnumStmt *a, CreateEnumStmt *b) _equalCreateEnumStmt(CreateEnumStmt *a, CreateEnumStmt *b)
{ {
COMPARE_NODE_FIELD(typename); COMPARE_NODE_FIELD(typeName);
COMPARE_NODE_FIELD(vals); COMPARE_NODE_FIELD(vals);
return true; return true;
@ -1359,7 +1359,7 @@ static bool
_equalCreateDomainStmt(CreateDomainStmt *a, CreateDomainStmt *b) _equalCreateDomainStmt(CreateDomainStmt *a, CreateDomainStmt *b)
{ {
COMPARE_NODE_FIELD(domainname); COMPARE_NODE_FIELD(domainname);
COMPARE_NODE_FIELD(typename); COMPARE_NODE_FIELD(typeName);
COMPARE_NODE_FIELD(constraints); COMPARE_NODE_FIELD(constraints);
return true; return true;
@ -1966,7 +1966,7 @@ static bool
_equalTypeName(TypeName *a, TypeName *b) _equalTypeName(TypeName *a, TypeName *b)
{ {
COMPARE_NODE_FIELD(names); COMPARE_NODE_FIELD(names);
COMPARE_SCALAR_FIELD(typeid); COMPARE_SCALAR_FIELD(typeOid);
COMPARE_SCALAR_FIELD(setof); COMPARE_SCALAR_FIELD(setof);
COMPARE_SCALAR_FIELD(pct_type); COMPARE_SCALAR_FIELD(pct_type);
COMPARE_NODE_FIELD(typmods); COMPARE_NODE_FIELD(typmods);
@ -1981,7 +1981,7 @@ static bool
_equalTypeCast(TypeCast *a, TypeCast *b) _equalTypeCast(TypeCast *a, TypeCast *b)
{ {
COMPARE_NODE_FIELD(arg); COMPARE_NODE_FIELD(arg);
COMPARE_NODE_FIELD(typename); COMPARE_NODE_FIELD(typeName);
COMPARE_LOCATION_FIELD(location); COMPARE_LOCATION_FIELD(location);
return true; return true;
@ -2047,7 +2047,7 @@ static bool
_equalColumnDef(ColumnDef *a, ColumnDef *b) _equalColumnDef(ColumnDef *a, ColumnDef *b)
{ {
COMPARE_STRING_FIELD(colname); COMPARE_STRING_FIELD(colname);
COMPARE_NODE_FIELD(typename); COMPARE_NODE_FIELD(typeName);
COMPARE_SCALAR_FIELD(inhcount); COMPARE_SCALAR_FIELD(inhcount);
COMPARE_SCALAR_FIELD(is_local); COMPARE_SCALAR_FIELD(is_local);
COMPARE_SCALAR_FIELD(is_not_null); COMPARE_SCALAR_FIELD(is_not_null);
@ -2207,7 +2207,7 @@ _equalXmlSerialize(XmlSerialize *a, XmlSerialize *b)
{ {
COMPARE_SCALAR_FIELD(xmloption); COMPARE_SCALAR_FIELD(xmloption);
COMPARE_NODE_FIELD(expr); COMPARE_NODE_FIELD(expr);
COMPARE_NODE_FIELD(typename); COMPARE_NODE_FIELD(typeName);
COMPARE_LOCATION_FIELD(location); COMPARE_LOCATION_FIELD(location);
return true; return true;

View File

@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * 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. * build a TypeName node to represent a type already known by OID/typmod.
*/ */
TypeName * TypeName *
makeTypeNameFromOid(Oid typeid, int32 typmod) makeTypeNameFromOid(Oid typeOid, int32 typmod)
{ {
TypeName *n = makeNode(TypeName); TypeName *n = makeNode(TypeName);
n->typeid = typeid; n->typeOid = typeOid;
n->typemod = typmod; n->typemod = typmod;
n->location = -1; n->location = -1;
return n; return n;
@ -373,12 +373,12 @@ makeDefElem(char *name, Node *arg)
* build a DefElem node with all fields available to be specified * build a DefElem node with all fields available to be specified
*/ */
DefElem * DefElem *
makeDefElemExtended(char *namespace, char *name, Node *arg, makeDefElemExtended(char *nameSpace, char *name, Node *arg,
DefElemAction defaction) DefElemAction defaction)
{ {
DefElem *res = makeNode(DefElem); DefElem *res = makeNode(DefElem);
res->defnamespace = namespace; res->defnamespace = nameSpace;
res->defname = name; res->defname = name;
res->arg = arg; res->arg = arg;
res->defaction = defaction; res->defaction = defaction;

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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. * any of the components might be leftmost.
*/ */
loc = exprLocation(tc->arg); loc = exprLocation(tc->arg);
loc = leftmostLoc(loc, tc->typename->location); loc = leftmostLoc(loc, tc->typeName->location);
loc = leftmostLoc(loc, tc->location); loc = leftmostLoc(loc, tc->location);
} }
break; break;
@ -2417,7 +2417,7 @@ bool
if (walker(tc->arg, context)) if (walker(tc->arg, context))
return true; return true;
if (walker(tc->typename, context)) if (walker(tc->typeName, context))
return true; return true;
} }
break; break;
@ -2468,7 +2468,7 @@ bool
{ {
ColumnDef *coldef = (ColumnDef *) node; ColumnDef *coldef = (ColumnDef *) node;
if (walker(coldef->typename, context)) if (walker(coldef->typeName, context))
return true; return true;
if (walker(coldef->raw_default, context)) if (walker(coldef->raw_default, context))
return true; return true;
@ -2483,7 +2483,7 @@ bool
if (walker(xs->expr, context)) if (walker(xs->expr, context))
return true; return true;
if (walker(xs->typename, context)) if (walker(xs->typeName, context))
return true; return true;
} }
break; break;

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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 * NOTES
* Every node type that can appear in stored rules' parsetrees *must* * 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_BOOL_FIELD(isNatural);
WRITE_NODE_FIELD(larg); WRITE_NODE_FIELD(larg);
WRITE_NODE_FIELD(rarg); WRITE_NODE_FIELD(rarg);
WRITE_NODE_FIELD(using); WRITE_NODE_FIELD(usingClause);
WRITE_NODE_FIELD(quals); WRITE_NODE_FIELD(quals);
WRITE_NODE_FIELD(alias); WRITE_NODE_FIELD(alias);
WRITE_INT_FIELD(rtindex); WRITE_INT_FIELD(rtindex);
@ -1822,7 +1822,7 @@ _outXmlSerialize(StringInfo str, XmlSerialize *node)
WRITE_ENUM_FIELD(xmloption, XmlOptionType); WRITE_ENUM_FIELD(xmloption, XmlOptionType);
WRITE_NODE_FIELD(expr); WRITE_NODE_FIELD(expr);
WRITE_NODE_FIELD(typename); WRITE_NODE_FIELD(typeName);
WRITE_LOCATION_FIELD(location); WRITE_LOCATION_FIELD(location);
} }
@ -1832,7 +1832,7 @@ _outColumnDef(StringInfo str, ColumnDef *node)
WRITE_NODE_TYPE("COLUMNDEF"); WRITE_NODE_TYPE("COLUMNDEF");
WRITE_STRING_FIELD(colname); WRITE_STRING_FIELD(colname);
WRITE_NODE_FIELD(typename); WRITE_NODE_FIELD(typeName);
WRITE_INT_FIELD(inhcount); WRITE_INT_FIELD(inhcount);
WRITE_BOOL_FIELD(is_local); WRITE_BOOL_FIELD(is_local);
WRITE_BOOL_FIELD(is_not_null); WRITE_BOOL_FIELD(is_not_null);
@ -1847,7 +1847,7 @@ _outTypeName(StringInfo str, TypeName *node)
WRITE_NODE_TYPE("TYPENAME"); WRITE_NODE_TYPE("TYPENAME");
WRITE_NODE_FIELD(names); WRITE_NODE_FIELD(names);
WRITE_OID_FIELD(typeid); WRITE_OID_FIELD(typeOid);
WRITE_BOOL_FIELD(setof); WRITE_BOOL_FIELD(setof);
WRITE_BOOL_FIELD(pct_type); WRITE_BOOL_FIELD(pct_type);
WRITE_NODE_FIELD(typmods); WRITE_NODE_FIELD(typmods);
@ -1862,7 +1862,7 @@ _outTypeCast(StringInfo str, TypeCast *node)
WRITE_NODE_TYPE("TYPECAST"); WRITE_NODE_TYPE("TYPECAST");
WRITE_NODE_FIELD(arg); WRITE_NODE_FIELD(arg);
WRITE_NODE_FIELD(typename); WRITE_NODE_FIELD(typeName);
WRITE_LOCATION_FIELD(location); WRITE_LOCATION_FIELD(location);
} }

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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 * NOTES
* Path and Plan nodes do not have any readfuncs support, because we * Path and Plan nodes do not have any readfuncs support, because we
@ -1070,7 +1070,7 @@ _readJoinExpr(void)
READ_BOOL_FIELD(isNatural); READ_BOOL_FIELD(isNatural);
READ_NODE_FIELD(larg); READ_NODE_FIELD(larg);
READ_NODE_FIELD(rarg); READ_NODE_FIELD(rarg);
READ_NODE_FIELD(using); READ_NODE_FIELD(usingClause);
READ_NODE_FIELD(quals); READ_NODE_FIELD(quals);
READ_NODE_FIELD(alias); READ_NODE_FIELD(alias);
READ_INT_FIELD(rtindex); READ_INT_FIELD(rtindex);

View File

@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * 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->isNatural = false;
result->larg = NULL; /* caller must fill this in */ result->larg = NULL; /* caller must fill this in */
result->rarg = (Node *) rtr; result->rarg = (Node *) rtr;
result->using = NIL; result->usingClause = NIL;
result->quals = quals; result->quals = quals;
result->alias = NULL; result->alias = NULL;
result->rtindex = 0; /* we don't need an RTE for it */ 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); result->rarg = (Node *) linitial(subselect->jointree->fromlist);
else else
result->rarg = (Node *) subselect->jointree; result->rarg = (Node *) subselect->jointree;
result->using = NIL; result->usingClause = NIL;
result->quals = whereClause; result->quals = whereClause;
result->alias = NULL; result->alias = NULL;
result->rtindex = 0; /* we don't need an RTE for it */ result->rtindex = 0; /* we don't need an RTE for it */

View File

@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * 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 Selectivity
restriction_selectivity(PlannerInfo *root, restriction_selectivity(PlannerInfo *root,
Oid operator, Oid operatorid,
List *args, List *args,
int varRelid) int varRelid)
{ {
RegProcedure oprrest = get_oprrest(operator); RegProcedure oprrest = get_oprrest(operatorid);
float8 result; float8 result;
/* /*
@ -799,7 +799,7 @@ restriction_selectivity(PlannerInfo *root,
result = DatumGetFloat8(OidFunctionCall4(oprrest, result = DatumGetFloat8(OidFunctionCall4(oprrest,
PointerGetDatum(root), PointerGetDatum(root),
ObjectIdGetDatum(operator), ObjectIdGetDatum(operatorid),
PointerGetDatum(args), PointerGetDatum(args),
Int32GetDatum(varRelid))); Int32GetDatum(varRelid)));
@ -818,12 +818,12 @@ restriction_selectivity(PlannerInfo *root,
*/ */
Selectivity Selectivity
join_selectivity(PlannerInfo *root, join_selectivity(PlannerInfo *root,
Oid operator, Oid operatorid,
List *args, List *args,
JoinType jointype, JoinType jointype,
SpecialJoinInfo *sjinfo) SpecialJoinInfo *sjinfo)
{ {
RegProcedure oprjoin = get_oprjoin(operator); RegProcedure oprjoin = get_oprjoin(operatorid);
float8 result; float8 result;
/* /*
@ -835,7 +835,7 @@ join_selectivity(PlannerInfo *root,
result = DatumGetFloat8(OidFunctionCall5(oprjoin, result = DatumGetFloat8(OidFunctionCall5(oprjoin,
PointerGetDatum(root), PointerGetDatum(root),
ObjectIdGetDatum(operator), ObjectIdGetDatum(operatorid),
PointerGetDatum(args), PointerGetDatum(args),
Int16GetDatum(jointype), Int16GetDatum(jointype),
PointerGetDatum(sjinfo))); PointerGetDatum(sjinfo)));

View File

@ -11,7 +11,7 @@
* *
* *
* IDENTIFICATION * 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 * HISTORY
* AUTHOR DATE MAJOR EVENT * AUTHOR DATE MAJOR EVENT
@ -2127,7 +2127,7 @@ columnDef: ColId Typename ColQualList
{ {
ColumnDef *n = makeNode(ColumnDef); ColumnDef *n = makeNode(ColumnDef);
n->colname = $1; n->colname = $1;
n->typename = $2; n->typeName = $2;
n->constraints = $3; n->constraints = $3;
n->is_local = true; n->is_local = true;
$$ = (Node *)n; $$ = (Node *)n;
@ -2574,7 +2574,7 @@ CreateAsElement:
{ {
ColumnDef *n = makeNode(ColumnDef); ColumnDef *n = makeNode(ColumnDef);
n->colname = $1; n->colname = $1;
n->typename = NULL; n->typeName = NULL;
n->inhcount = 0; n->inhcount = 0;
n->is_local = true; n->is_local = true;
n->is_not_null = false; n->is_not_null = false;
@ -3461,7 +3461,7 @@ DefineStmt:
| CREATE TYPE_P any_name AS ENUM_P '(' enum_val_list ')' | CREATE TYPE_P any_name AS ENUM_P '(' enum_val_list ')'
{ {
CreateEnumStmt *n = makeNode(CreateEnumStmt); CreateEnumStmt *n = makeNode(CreateEnumStmt);
n->typename = $3; n->typeName = $3;
n->vals = $7; n->vals = $7;
$$ = (Node *)n; $$ = (Node *)n;
} }
@ -6144,7 +6144,7 @@ CreateDomainStmt:
{ {
CreateDomainStmt *n = makeNode(CreateDomainStmt); CreateDomainStmt *n = makeNode(CreateDomainStmt);
n->domainname = $3; n->domainname = $3;
n->typename = $5; n->typeName = $5;
n->constraints = $6; n->constraints = $6;
$$ = (Node *)n; $$ = (Node *)n;
} }
@ -6156,7 +6156,7 @@ AlterDomainStmt:
{ {
AlterDomainStmt *n = makeNode(AlterDomainStmt); AlterDomainStmt *n = makeNode(AlterDomainStmt);
n->subtype = 'T'; n->subtype = 'T';
n->typename = $3; n->typeName = $3;
n->def = $4; n->def = $4;
$$ = (Node *)n; $$ = (Node *)n;
} }
@ -6165,7 +6165,7 @@ AlterDomainStmt:
{ {
AlterDomainStmt *n = makeNode(AlterDomainStmt); AlterDomainStmt *n = makeNode(AlterDomainStmt);
n->subtype = 'N'; n->subtype = 'N';
n->typename = $3; n->typeName = $3;
$$ = (Node *)n; $$ = (Node *)n;
} }
/* ALTER DOMAIN <domain> SET NOT NULL */ /* ALTER DOMAIN <domain> SET NOT NULL */
@ -6173,7 +6173,7 @@ AlterDomainStmt:
{ {
AlterDomainStmt *n = makeNode(AlterDomainStmt); AlterDomainStmt *n = makeNode(AlterDomainStmt);
n->subtype = 'O'; n->subtype = 'O';
n->typename = $3; n->typeName = $3;
$$ = (Node *)n; $$ = (Node *)n;
} }
/* ALTER DOMAIN <domain> ADD CONSTRAINT ... */ /* ALTER DOMAIN <domain> ADD CONSTRAINT ... */
@ -6181,7 +6181,7 @@ AlterDomainStmt:
{ {
AlterDomainStmt *n = makeNode(AlterDomainStmt); AlterDomainStmt *n = makeNode(AlterDomainStmt);
n->subtype = 'C'; n->subtype = 'C';
n->typename = $3; n->typeName = $3;
n->def = $5; n->def = $5;
$$ = (Node *)n; $$ = (Node *)n;
} }
@ -6190,7 +6190,7 @@ AlterDomainStmt:
{ {
AlterDomainStmt *n = makeNode(AlterDomainStmt); AlterDomainStmt *n = makeNode(AlterDomainStmt);
n->subtype = 'X'; n->subtype = 'X';
n->typename = $3; n->typeName = $3;
n->name = $6; n->name = $6;
n->behavior = $7; n->behavior = $7;
$$ = (Node *)n; $$ = (Node *)n;
@ -7463,7 +7463,7 @@ joined_table:
n->isNatural = FALSE; n->isNatural = FALSE;
n->larg = $1; n->larg = $1;
n->rarg = $4; n->rarg = $4;
n->using = NIL; n->usingClause = NIL;
n->quals = NULL; n->quals = NULL;
$$ = n; $$ = n;
} }
@ -7475,7 +7475,7 @@ joined_table:
n->larg = $1; n->larg = $1;
n->rarg = $4; n->rarg = $4;
if ($5 != NULL && IsA($5, List)) if ($5 != NULL && IsA($5, List))
n->using = (List *) $5; /* USING clause */ n->usingClause = (List *) $5; /* USING clause */
else else
n->quals = $5; /* ON clause */ n->quals = $5; /* ON clause */
$$ = n; $$ = n;
@ -7489,7 +7489,7 @@ joined_table:
n->larg = $1; n->larg = $1;
n->rarg = $3; n->rarg = $3;
if ($4 != NULL && IsA($4, List)) if ($4 != NULL && IsA($4, List))
n->using = (List *) $4; /* USING clause */ n->usingClause = (List *) $4; /* USING clause */
else else
n->quals = $4; /* ON clause */ n->quals = $4; /* ON clause */
$$ = n; $$ = n;
@ -7501,7 +7501,7 @@ joined_table:
n->isNatural = TRUE; n->isNatural = TRUE;
n->larg = $1; n->larg = $1;
n->rarg = $5; 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->quals = NULL; /* fill later */
$$ = n; $$ = n;
} }
@ -7513,7 +7513,7 @@ joined_table:
n->isNatural = TRUE; n->isNatural = TRUE;
n->larg = $1; n->larg = $1;
n->rarg = $4; 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->quals = NULL; /* fill later */
$$ = n; $$ = n;
} }
@ -7684,7 +7684,7 @@ TableFuncElement: ColId Typename
{ {
ColumnDef *n = makeNode(ColumnDef); ColumnDef *n = makeNode(ColumnDef);
n->colname = $1; n->colname = $1;
n->typename = $2; n->typeName = $2;
n->constraints = NIL; n->constraints = NIL;
n->is_local = true; n->is_local = true;
$$ = (Node *)n; $$ = (Node *)n;
@ -9280,7 +9280,7 @@ func_expr: func_name '(' ')' over_clause
XmlSerialize *n = makeNode(XmlSerialize); XmlSerialize *n = makeNode(XmlSerialize);
n->xmloption = $3; n->xmloption = $3;
n->expr = $4; n->expr = $4;
n->typename = $6; n->typeName = $6;
n->location = @1; n->location = @1;
$$ = (Node *)n; $$ = (Node *)n;
} }
@ -10668,7 +10668,7 @@ makeTypeCast(Node *arg, TypeName *typename, int location)
{ {
TypeCast *n = makeNode(TypeCast); TypeCast *n = makeNode(TypeCast);
n->arg = arg; n->arg = arg;
n->typename = typename; n->typeName = typename;
n->location = location; n->location = location;
return (Node *) n; return (Node *) n;
} }

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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, ListCell *lx,
*rx; *rx;
Assert(j->using == NIL); /* shouldn't have USING() too */ Assert(j->usingClause == NIL); /* shouldn't have USING() too */
foreach(lx, l_colnames) foreach(lx, l_colnames)
{ {
@ -819,7 +819,7 @@ transformFromClauseItem(ParseState *pstate, Node *n,
rlist = lappend(rlist, m_name); rlist = lappend(rlist, m_name);
} }
j->using = rlist; j->usingClause = rlist;
} }
/* /*
@ -828,14 +828,14 @@ transformFromClauseItem(ParseState *pstate, Node *n,
res_colnames = NIL; res_colnames = NIL;
res_colvars = NIL; res_colvars = NIL;
if (j->using) if (j->usingClause)
{ {
/* /*
* JOIN/USING (or NATURAL JOIN, as transformed above). Transform * JOIN/USING (or NATURAL JOIN, as transformed above). Transform
* the list into an explicit ON-condition, and generate a list of * the list into an explicit ON-condition, and generate a list of
* merged result columns. * merged result columns.
*/ */
List *ucols = j->using; List *ucols = j->usingClause;
List *l_usingvars = NIL; List *l_usingvars = NIL;
List *r_usingvars = NIL; List *r_usingvars = NIL;
ListCell *ucol; ListCell *ucol;

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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; Oid elementType;
int32 targetTypmod; int32 targetTypmod;
targetType = typenameTypeId(pstate, tc->typename, targetType = typenameTypeId(pstate, tc->typeName,
&targetTypmod); &targetTypmod);
elementType = get_element_type(targetType); elementType = get_element_type(targetType);
if (OidIsValid(elementType)) if (OidIsValid(elementType))
@ -1773,7 +1773,7 @@ transformXmlSerialize(ParseState *pstate, XmlSerialize *xs)
XMLOID, XMLOID,
"XMLSERIALIZE")); "XMLSERIALIZE"));
targetType = typenameTypeId(pstate, xs->typename, &targetTypmod); targetType = typenameTypeId(pstate, xs->typeName, &targetTypmod);
xexpr->xmloption = xs->xmloption; xexpr->xmloption = xs->xmloption;
xexpr->location = xs->location; xexpr->location = xs->location;
@ -2000,7 +2000,7 @@ transformTypeCast(ParseState *pstate, TypeCast *tc)
int32 targetTypmod; int32 targetTypmod;
int location; int location;
targetType = typenameTypeId(pstate, tc->typename, &targetTypmod); targetType = typenameTypeId(pstate, tc->typeName, &targetTypmod);
if (inputType == InvalidOid) if (inputType == InvalidOid)
return expr; /* do nothing if NULL input */ return expr; /* do nothing if NULL input */
@ -2012,7 +2012,7 @@ transformTypeCast(ParseState *pstate, TypeCast *tc)
*/ */
location = tc->location; location = tc->location;
if (location < 0) if (location < 0)
location = tc->typename->location; location = tc->typeName->location;
result = coerce_to_target_type(pstate, expr, inputType, result = coerce_to_target_type(pstate, expr, inputType,
targetType, targetTypmod, targetType, targetTypmod,

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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; int32 attrtypmod;
attrname = pstrdup(n->colname); attrname = pstrdup(n->colname);
if (n->typename->setof) if (n->typeName->setof)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_INVALID_TABLE_DEFINITION), (errcode(ERRCODE_INVALID_TABLE_DEFINITION),
errmsg("column \"%s\" cannot be declared SETOF", errmsg("column \"%s\" cannot be declared SETOF",
attrname), attrname),
parser_errposition(pstate, n->typename->location))); parser_errposition(pstate, n->typeName->location)));
attrtype = typenameTypeId(pstate, n->typename, &attrtypmod); attrtype = typenameTypeId(pstate, n->typeName, &attrtypmod);
eref->colnames = lappend(eref->colnames, makeString(attrname)); eref->colnames = lappend(eref->colnames, makeString(attrname));
rte->funccoltypes = lappend_oid(rte->funccoltypes, attrtype); rte->funccoltypes = lappend_oid(rte->funccoltypes, attrtype);
rte->funccoltypmods = lappend_int(rte->funccoltypmods, attrtypmod); rte->funccoltypmods = lappend_int(rte->funccoltypmods, attrtypmod);

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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); name);
if (strength <= 1) 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; return 1;
} }
} }

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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" #include "utils/syscache.h"
static int32 typenameTypeMod(ParseState *pstate, const TypeName *typename, static int32 typenameTypeMod(ParseState *pstate, const TypeName *typeName,
Type typ); 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. * pstate is only used for error location info, and may be NULL.
*/ */
Type Type
LookupTypeName(ParseState *pstate, const TypeName *typename, LookupTypeName(ParseState *pstate, const TypeName *typeName,
int32 *typmod_p) int32 *typmod_p)
{ {
Oid typoid; Oid typoid;
HeapTuple tup; HeapTuple tup;
int32 typmod; int32 typmod;
if (typename->names == NIL) if (typeName->names == NIL)
{ {
/* We have the OID already if it's an internally generated TypeName */ /* 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 */ /* 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; char *field = NULL;
Oid relid; Oid relid;
AttrNumber attnum; AttrNumber attnum;
/* deconstruct the name list */ /* deconstruct the name list */
switch (list_length(typename->names)) switch (list_length(typeName->names))
{ {
case 1: case 1:
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR), (errcode(ERRCODE_SYNTAX_ERROR),
errmsg("improper %%TYPE reference (too few dotted names): %s", errmsg("improper %%TYPE reference (too few dotted names): %s",
NameListToString(typename->names)), NameListToString(typeName->names)),
parser_errposition(pstate, typename->location))); parser_errposition(pstate, typeName->location)));
break; break;
case 2: case 2:
rel->relname = strVal(linitial(typename->names)); rel->relname = strVal(linitial(typeName->names));
field = strVal(lsecond(typename->names)); field = strVal(lsecond(typeName->names));
break; break;
case 3: case 3:
rel->schemaname = strVal(linitial(typename->names)); rel->schemaname = strVal(linitial(typeName->names));
rel->relname = strVal(lsecond(typename->names)); rel->relname = strVal(lsecond(typeName->names));
field = strVal(lthird(typename->names)); field = strVal(lthird(typeName->names));
break; break;
case 4: case 4:
rel->catalogname = strVal(linitial(typename->names)); rel->catalogname = strVal(linitial(typeName->names));
rel->schemaname = strVal(lsecond(typename->names)); rel->schemaname = strVal(lsecond(typeName->names));
rel->relname = strVal(lthird(typename->names)); rel->relname = strVal(lthird(typeName->names));
field = strVal(lfourth(typename->names)); field = strVal(lfourth(typeName->names));
break; break;
default: default:
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR), (errcode(ERRCODE_SYNTAX_ERROR),
errmsg("improper %%TYPE reference (too many dotted names): %s", errmsg("improper %%TYPE reference (too many dotted names): %s",
NameListToString(typename->names)), NameListToString(typeName->names)),
parser_errposition(pstate, typename->location))); parser_errposition(pstate, typeName->location)));
break; break;
} }
@ -116,16 +116,16 @@ LookupTypeName(ParseState *pstate, const TypeName *typename,
(errcode(ERRCODE_UNDEFINED_COLUMN), (errcode(ERRCODE_UNDEFINED_COLUMN),
errmsg("column \"%s\" of relation \"%s\" does not exist", errmsg("column \"%s\" of relation \"%s\" does not exist",
field, rel->relname), field, rel->relname),
parser_errposition(pstate, typename->location))); parser_errposition(pstate, typeName->location)));
typoid = get_atttype(relid, attnum); typoid = get_atttype(relid, attnum);
/* this construct should never have an array indicator */ /* this construct should never have an array indicator */
Assert(typename->arrayBounds == NIL); Assert(typeName->arrayBounds == NIL);
/* emit nuisance notice (intentionally not errposition'd) */ /* emit nuisance notice (intentionally not errposition'd) */
ereport(NOTICE, ereport(NOTICE,
(errmsg("type reference %s converted to %s", (errmsg("type reference %s converted to %s",
TypeNameToString(typename), TypeNameToString(typeName),
format_type_be(typoid)))); format_type_be(typoid))));
} }
else else
@ -135,7 +135,7 @@ LookupTypeName(ParseState *pstate, const TypeName *typename,
char *typname; char *typname;
/* deconstruct the name list */ /* deconstruct the name list */
DeconstructQualifiedName(typename->names, &schemaname, &typname); DeconstructQualifiedName(typeName->names, &schemaname, &typname);
if (schemaname) if (schemaname)
{ {
@ -155,7 +155,7 @@ LookupTypeName(ParseState *pstate, const TypeName *typename,
} }
/* If an array reference, return the array type instead */ /* If an array reference, return the array type instead */
if (typename->arrayBounds != NIL) if (typeName->arrayBounds != NIL)
typoid = get_array_type(typoid); typoid = get_array_type(typoid);
} }
@ -172,7 +172,7 @@ LookupTypeName(ParseState *pstate, const TypeName *typename,
if (!HeapTupleIsValid(tup)) /* should not happen */ if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for type %u", typoid); elog(ERROR, "cache lookup failed for type %u", typoid);
typmod = typenameTypeMod(pstate, typename, (Type) tup); typmod = typenameTypeMod(pstate, typeName, (Type) tup);
if (typmod_p) if (typmod_p)
*typmod_p = typmod; *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. * Callers of this can therefore assume the result is a fully valid type.
*/ */
Type Type
typenameType(ParseState *pstate, const TypeName *typename, int32 *typmod_p) typenameType(ParseState *pstate, const TypeName *typeName, int32 *typmod_p)
{ {
Type tup; Type tup;
tup = LookupTypeName(pstate, typename, typmod_p); tup = LookupTypeName(pstate, typeName, typmod_p);
if (tup == NULL) if (tup == NULL)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT), (errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("type \"%s\" does not exist", errmsg("type \"%s\" does not exist",
TypeNameToString(typename)), TypeNameToString(typeName)),
parser_errposition(pstate, typename->location))); parser_errposition(pstate, typeName->location)));
if (!((Form_pg_type) GETSTRUCT(tup))->typisdefined) if (!((Form_pg_type) GETSTRUCT(tup))->typisdefined)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT), (errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("type \"%s\" is only a shell", errmsg("type \"%s\" is only a shell",
TypeNameToString(typename)), TypeNameToString(typeName)),
parser_errposition(pstate, typename->location))); parser_errposition(pstate, typeName->location)));
return tup; return tup;
} }
@ -215,12 +215,12 @@ typenameType(ParseState *pstate, const TypeName *typename, int32 *typmod_p)
* not the syscache entry. * not the syscache entry.
*/ */
Oid Oid
typenameTypeId(ParseState *pstate, const TypeName *typename, int32 *typmod_p) typenameTypeId(ParseState *pstate, const TypeName *typeName, int32 *typmod_p)
{ {
Oid typoid; Oid typoid;
Type tup; Type tup;
tup = typenameType(pstate, typename, typmod_p); tup = typenameType(pstate, typeName, typmod_p);
typoid = HeapTupleGetOid(tup); typoid = HeapTupleGetOid(tup);
ReleaseSysCache(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. * pstate is only used for error location info, and may be NULL.
*/ */
static int32 static int32
typenameTypeMod(ParseState *pstate, const TypeName *typename, Type typ) typenameTypeMod(ParseState *pstate, const TypeName *typeName, Type typ)
{ {
int32 result; int32 result;
Oid typmodin; Oid typmodin;
@ -250,8 +250,8 @@ typenameTypeMod(ParseState *pstate, const TypeName *typename, Type typ)
ParseCallbackState pcbstate; ParseCallbackState pcbstate;
/* Return prespecified typmod if no typmod expressions */ /* Return prespecified typmod if no typmod expressions */
if (typename->typmods == NIL) if (typeName->typmods == NIL)
return typename->typemod; return typeName->typemod;
/* /*
* Else, type had better accept typmods. We give a special error message * 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, ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR), (errcode(ERRCODE_SYNTAX_ERROR),
errmsg("type modifier cannot be specified for shell type \"%s\"", errmsg("type modifier cannot be specified for shell type \"%s\"",
TypeNameToString(typename)), TypeNameToString(typeName)),
parser_errposition(pstate, typename->location))); parser_errposition(pstate, typeName->location)));
typmodin = ((Form_pg_type) GETSTRUCT(typ))->typmodin; typmodin = ((Form_pg_type) GETSTRUCT(typ))->typmodin;
@ -271,17 +271,17 @@ typenameTypeMod(ParseState *pstate, const TypeName *typename, Type typ)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR), (errcode(ERRCODE_SYNTAX_ERROR),
errmsg("type modifier is not allowed for type \"%s\"", errmsg("type modifier is not allowed for type \"%s\"",
TypeNameToString(typename)), TypeNameToString(typeName)),
parser_errposition(pstate, typename->location))); parser_errposition(pstate, typeName->location)));
/* /*
* Convert the list of raw-grammar-output expressions to a cstring array. * Convert the list of raw-grammar-output expressions to a cstring array.
* Currently, we allow simple numeric constants, string literals, and * Currently, we allow simple numeric constants, string literals, and
* identifiers; possibly this list could be extended. * 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; n = 0;
foreach(l, typename->typmods) foreach(l, typeName->typmods)
{ {
Node *tm = (Node *) lfirst(l); Node *tm = (Node *) lfirst(l);
char *cstr = NULL; char *cstr = NULL;
@ -314,7 +314,7 @@ typenameTypeMod(ParseState *pstate, const TypeName *typename, Type typ)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR), (errcode(ERRCODE_SYNTAX_ERROR),
errmsg("type modifiers must be simple constants or identifiers"), errmsg("type modifiers must be simple constants or identifiers"),
parser_errposition(pstate, typename->location))); parser_errposition(pstate, typeName->location)));
datums[n++] = CStringGetDatum(cstr); datums[n++] = CStringGetDatum(cstr);
} }
@ -323,7 +323,7 @@ typenameTypeMod(ParseState *pstate, const TypeName *typename, Type typ)
-2, false, 'c'); -2, false, 'c');
/* arrange to report location if type's typmodin function fails */ /* 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, result = DatumGetInt32(OidFunctionCall1(typmodin,
PointerGetDatum(arrtypmod))); PointerGetDatum(arrtypmod)));
@ -345,16 +345,16 @@ typenameTypeMod(ParseState *pstate, const TypeName *typename, Type typ)
* it is mostly used for reporting lookup errors. * it is mostly used for reporting lookup errors.
*/ */
static void 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 */ /* Emit possibly-qualified name as-is */
ListCell *l; ListCell *l;
foreach(l, typename->names) foreach(l, typeName->names)
{ {
if (l != list_head(typename->names)) if (l != list_head(typeName->names))
appendStringInfoChar(string, '.'); appendStringInfoChar(string, '.');
appendStringInfoString(string, strVal(lfirst(l))); appendStringInfoString(string, strVal(lfirst(l)));
} }
@ -362,17 +362,17 @@ appendTypeNameToBuffer(const TypeName *typename, StringInfo string)
else else
{ {
/* Look up internally-specified type */ /* 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 * Add decoration as needed, but only for fields considered by
* LookupTypeName * LookupTypeName
*/ */
if (typename->pct_type) if (typeName->pct_type)
appendStringInfoString(string, "%TYPE"); appendStringInfoString(string, "%TYPE");
if (typename->arrayBounds != NIL) if (typeName->arrayBounds != NIL)
appendStringInfoString(string, "[]"); appendStringInfoString(string, "[]");
} }
@ -384,12 +384,12 @@ appendTypeNameToBuffer(const TypeName *typename, StringInfo string)
* it is mostly used for reporting lookup errors. * it is mostly used for reporting lookup errors.
*/ */
char * char *
TypeNameToString(const TypeName *typename) TypeNameToString(const TypeName *typeName)
{ {
StringInfoData string; StringInfoData string;
initStringInfo(&string); initStringInfo(&string);
appendTypeNameToBuffer(typename, &string); appendTypeNameToBuffer(typeName, &string);
return string.data; return string.data;
} }
@ -406,12 +406,12 @@ TypeNameListToString(List *typenames)
initStringInfo(&string); initStringInfo(&string);
foreach(l, typenames) 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)) if (l != list_head(typenames))
appendStringInfoChar(&string, ','); appendStringInfoChar(&string, ',');
appendTypeNameToBuffer(typename, &string); appendTypeNameToBuffer(typeName, &string);
} }
return string.data; return string.data;
} }
@ -575,7 +575,7 @@ parseTypeString(const char *str, Oid *type_id, int32 *typmod_p)
SelectStmt *stmt; SelectStmt *stmt;
ResTarget *restarget; ResTarget *restarget;
TypeCast *typecast; TypeCast *typecast;
TypeName *typename; TypeName *typeName;
ErrorContextCallback ptserrcontext; ErrorContextCallback ptserrcontext;
/* make sure we give useful error for empty input */ /* 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 || typecast->arg == NULL ||
!IsA(typecast->arg, A_Const)) !IsA(typecast->arg, A_Const))
goto fail; goto fail;
typename = typecast->typename; typeName = typecast->typeName;
if (typename == NULL || if (typeName == NULL ||
!IsA(typename, TypeName)) !IsA(typeName, TypeName))
goto fail; goto fail;
if (typename->setof) if (typeName->setof)
goto fail; goto fail;
*type_id = typenameTypeId(NULL, typename, typmod_p); *type_id = typenameTypeId(NULL, typeName, typmod_p);
pfree(buf.data); pfree(buf.data);

View File

@ -19,7 +19,7 @@
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * 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 */ /* Check for SERIAL pseudo-types */
is_serial = false; is_serial = false;
if (list_length(column->typename->names) == 1 && if (list_length(column->typeName->names) == 1 &&
!column->typename->pct_type) !column->typeName->pct_type)
{ {
char *typname = strVal(linitial(column->typename->names)); char *typname = strVal(linitial(column->typeName->names));
if (strcmp(typname, "serial") == 0 || if (strcmp(typname, "serial") == 0 ||
strcmp(typname, "serial4") == 0) strcmp(typname, "serial4") == 0)
{ {
is_serial = true; is_serial = true;
column->typename->names = NIL; column->typeName->names = NIL;
column->typename->typeid = INT4OID; column->typeName->typeOid = INT4OID;
} }
else if (strcmp(typname, "bigserial") == 0 || else if (strcmp(typname, "bigserial") == 0 ||
strcmp(typname, "serial8") == 0) strcmp(typname, "serial8") == 0)
{ {
is_serial = true; is_serial = true;
column->typename->names = NIL; column->typeName->names = NIL;
column->typename->typeid = INT8OID; column->typeName->typeOid = INT8OID;
} }
/* /*
@ -291,7 +291,7 @@ transformColumnDefinition(ParseState *pstate, CreateStmtContext *cxt,
* typeid, LookupTypeName won't notice arrayBounds. We don't need any * typeid, LookupTypeName won't notice arrayBounds. We don't need any
* special coding for serial(typmod) though. * special coding for serial(typmod) though.
*/ */
if (is_serial && column->typename->arrayBounds != NIL) if (is_serial && column->typeName->arrayBounds != NIL)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("array of serial is not implemented"))); errmsg("array of serial is not implemented")));
@ -382,7 +382,7 @@ transformColumnDefinition(ParseState *pstate, CreateStmtContext *cxt,
snamenode->val.val.str = qstring; snamenode->val.val.str = qstring;
snamenode->location = -1; snamenode->location = -1;
castnode = makeNode(TypeCast); castnode = makeNode(TypeCast);
castnode->typename = SystemTypeName("regclass"); castnode->typeName = SystemTypeName("regclass");
castnode->arg = (Node *) snamenode; castnode->arg = (Node *) snamenode;
castnode->location = -1; castnode->location = -1;
funccallnode = makeNode(FuncCall); funccallnode = makeNode(FuncCall);
@ -623,7 +623,7 @@ transformInhRelation(ParseState *pstate, CreateStmtContext *cxt,
*/ */
def = makeNode(ColumnDef); def = makeNode(ColumnDef);
def->colname = pstrdup(attributeName); def->colname = pstrdup(attributeName);
def->typename = makeTypeNameFromOid(attribute->atttypid, def->typeName = makeTypeNameFromOid(attribute->atttypid,
attribute->atttypmod); attribute->atttypmod);
def->inhcount = 0; def->inhcount = 0;
def->is_local = true; 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. * 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); ReleaseSysCache(ctype);
} }

View File

@ -10,7 +10,7 @@
* *
* *
* IDENTIFICATION * 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 * Recursively alter column default for table and, if
* requested, for descendants * requested, for descendants
*/ */
AlterDomainDefault(stmt->typename, AlterDomainDefault(stmt->typeName,
stmt->def); stmt->def);
break; break;
case 'N': /* ALTER DOMAIN DROP NOT NULL */ case 'N': /* ALTER DOMAIN DROP NOT NULL */
AlterDomainNotNull(stmt->typename, AlterDomainNotNull(stmt->typeName,
false); false);
break; break;
case 'O': /* ALTER DOMAIN SET NOT NULL */ case 'O': /* ALTER DOMAIN SET NOT NULL */
AlterDomainNotNull(stmt->typename, AlterDomainNotNull(stmt->typeName,
true); true);
break; break;
case 'C': /* ADD CONSTRAINT */ case 'C': /* ADD CONSTRAINT */
AlterDomainAddConstraint(stmt->typename, AlterDomainAddConstraint(stmt->typeName,
stmt->def); stmt->def);
break; break;
case 'X': /* DROP CONSTRAINT */ case 'X': /* DROP CONSTRAINT */
AlterDomainDropConstraint(stmt->typename, AlterDomainDropConstraint(stmt->typeName,
stmt->name, stmt->name,
stmt->behavior); stmt->behavior);
break; break;

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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) if (dstate->isend)
PG_RETURN_POINTER(NULL); PG_RETURN_POINTER(NULL);
stored = (LexemeInfo *) dstate->private; stored = (LexemeInfo *) dstate->private_state;
if (stored) if (stored)
curpos = stored->posinsubst + 1; curpos = stored->posinsubst + 1;
@ -859,7 +859,7 @@ thesaurus_lexize(PG_FUNCTION_ARGS)
info = NULL; /* word isn't recognized */ info = NULL; /* word isn't recognized */
} }
dstate->private = (void *) info; dstate->private_state = (void *) info;
if (!info) if (!info)
{ {

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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]); dict = lookup_ts_dictionary_cache(map->dictIds[i]);
ld->dictState.isend = ld->dictState.getnext = false; ld->dictState.isend = ld->dictState.getnext = false;
ld->dictState.private = NULL; ld->dictState.private_state = NULL;
res = (TSLexeme *) DatumGetPointer(FunctionCall4( res = (TSLexeme *) DatumGetPointer(FunctionCall4(
&(dict->lexize), &(dict->lexize),
PointerGetDatum(dict->dictData), PointerGetDatum(dict->dictData),
@ -464,18 +464,18 @@ hlfinditem(HeadlineParsedText *prs, TSQuery query, char *buf, int buflen)
for (i = 0; i < query->size; i++) for (i = 0; i < query->size; i++)
{ {
if (item->type == QI_VAL && if (item->type == QI_VAL &&
tsCompareString(GETOPERAND(query) + item->operand.distance, item->operand.length, tsCompareString(GETOPERAND(query) + item->qoperand.distance, item->qoperand.length,
buf, buflen, item->operand.prefix) == 0) buf, buflen, item->qoperand.prefix) == 0)
{ {
if (word->item) if (word->item)
{ {
memcpy(&(prs->words[prs->curwords]), word, sizeof(HeadlineWordEntry)); 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->words[prs->curwords].repeated = 1;
prs->curwords++; prs->curwords++;
} }
else else
word->item = &item->operand; word->item = &item->qoperand;
} }
item++; item++;
} }

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 */ /* Current TSQuery node is an operator */
switch (item->operator.oper) switch (item->qoperator.oper)
{ {
case OP_NOT: case OP_NOT:
selec = 1.0 - tsquery_opr_selec(item + 1, operand, selec = 1.0 - tsquery_opr_selec(item + 1, operand,
@ -317,7 +317,7 @@ tsquery_opr_selec(QueryItem *item, char *operand,
case OP_AND: case OP_AND:
s1 = tsquery_opr_selec(item + 1, operand, s1 = tsquery_opr_selec(item + 1, operand,
lookup, length, minfreq); lookup, length, minfreq);
s2 = tsquery_opr_selec(item + item->operator.left, operand, s2 = tsquery_opr_selec(item + item->qoperator.left, operand,
lookup, length, minfreq); lookup, length, minfreq);
selec = s1 * s2; selec = s1 * s2;
break; break;
@ -325,13 +325,13 @@ tsquery_opr_selec(QueryItem *item, char *operand,
case OP_OR: case OP_OR:
s1 = tsquery_opr_selec(item + 1, operand, s1 = tsquery_opr_selec(item + 1, operand,
lookup, length, minfreq); lookup, length, minfreq);
s2 = tsquery_opr_selec(item + item->operator.left, operand, s2 = tsquery_opr_selec(item + item->qoperator.left, operand,
lookup, length, minfreq); lookup, length, minfreq);
selec = s1 + s2 - s1 * s2; selec = s1 + s2 - s1 * s2;
break; break;
default: default:
elog(ERROR, "unrecognized operator: %d", item->operator.oper); elog(ERROR, "unrecognized operator: %d", item->qoperator.oper);
selec = 0; /* keep compiler quiet */ selec = 0; /* keep compiler quiet */
break; break;
} }

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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++) for (i = pos; i < prs->curwords; i++)
{ {
if (prs->words[i].item == &item->operand) if (prs->words[i].item == &item->qoperand)
{ {
if (i > *q) if (i > *q)
*q = i; *q = i;
@ -1973,7 +1973,7 @@ hlCover(HeadlineParsedText *prs, TSQuery query, int *p, int *q)
} }
for (i = *q; i >= pos; i--) for (i = *q; i >= pos; i--)
{ {
if (prs->words[i].item == &item->operand) if (prs->words[i].item == &item->qoperand)
{ {
if (i < *p) if (i < *p)
*p = i; *p = i;

View File

@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * 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->isNatural)
{ {
if (j->using) if (j->usingClause)
{ {
ListCell *col; ListCell *col;
appendStringInfo(buf, " USING ("); 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, ", "); appendStringInfo(buf, ", ");
appendStringInfoString(buf, appendStringInfoString(buf,
quote_identifier(strVal(lfirst(col)))); quote_identifier(strVal(lfirst(col))));
@ -6251,18 +6251,18 @@ quote_identifier(const char *ident)
/* /*
* quote_qualified_identifier - Quote a possibly-qualified identifier * 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. * is NULL, quoting each component if necessary. The result is palloc'd.
*/ */
char * char *
quote_qualified_identifier(const char *namespace, quote_qualified_identifier(const char *qualifier,
const char *ident) const char *ident)
{ {
StringInfoData buf; StringInfoData buf;
initStringInfo(&buf); initStringInfo(&buf);
if (namespace) if (qualifier)
appendStringInfo(&buf, "%s.", quote_identifier(namespace)); appendStringInfo(&buf, "%s.", quote_identifier(qualifier));
appendStringInfoString(&buf, quote_identifier(ident)); appendStringInfoString(&buf, quote_identifier(ident));
return buf.data; return buf.data;
} }

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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) if (item[i].type == QI_VAL)
{ {
text *txt; text *txt;
QueryOperand *val = &item[i].operand; QueryOperand *val = &item[i].qoperand;
txt = cstring_to_text_with_len(GETOPERAND(query) + val->distance, txt = cstring_to_text_with_len(GETOPERAND(query) + val->distance,
val->length); val->length);

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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); 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)++; (*pos)++;
findoprnd_recurse(ptr, pos, nnodes); findoprnd_recurse(ptr, pos, nnodes);
} }
else else
{ {
QueryOperator *curitem = &ptr[*pos].operator; QueryOperator *curitem = &ptr[*pos].qoperator;
int tmp = *pos; int tmp = *pos;
Assert(curitem->oper == OP_AND || curitem->oper == OP_OR); Assert(curitem->oper == OP_AND || curitem->oper == OP_OR);
@ -611,7 +611,7 @@ infix(INFIX *in, bool first)
if (in->curpol->type == QI_VAL) if (in->curpol->type == QI_VAL)
{ {
QueryOperand *curpol = &in->curpol->operand; QueryOperand *curpol = &in->curpol->qoperand;
char *op = in->op + curpol->distance; char *op = in->op + curpol->distance;
int clen; int clen;
@ -671,7 +671,7 @@ infix(INFIX *in, bool first)
*(in->cur) = '\0'; *(in->cur) = '\0';
in->curpol++; in->curpol++;
} }
else if (in->curpol->operator.oper == OP_NOT) else if (in->curpol->qoperator.oper == OP_NOT)
{ {
bool isopr = false; bool isopr = false;
@ -699,7 +699,7 @@ infix(INFIX *in, bool first)
} }
else else
{ {
int8 op = in->curpol->operator.oper; int8 op = in->curpol->qoperator.oper;
INFIX nrm; INFIX nrm;
in->curpol++; in->curpol++;
@ -808,12 +808,12 @@ tsquerysend(PG_FUNCTION_ARGS)
switch (item->type) switch (item->type)
{ {
case QI_VAL: case QI_VAL:
pq_sendint(&buf, item->operand.weight, sizeof(uint8)); pq_sendint(&buf, item->qoperand.weight, sizeof(uint8));
pq_sendint(&buf, item->operand.prefix, sizeof(uint8)); pq_sendint(&buf, item->qoperand.prefix, sizeof(uint8));
pq_sendstring(&buf, GETOPERAND(query) + item->operand.distance); pq_sendstring(&buf, GETOPERAND(query) + item->qoperand.distance);
break; break;
case QI_OPR: case QI_OPR:
pq_sendint(&buf, item->operator.oper, sizeof(item->operator.oper)); pq_sendint(&buf, item->qoperator.oper, sizeof(item->qoperator.oper));
break; break;
default: default:
elog(ERROR, "unrecognized tsquery node type: %d", item->type); elog(ERROR, "unrecognized tsquery node type: %d", item->type);
@ -887,11 +887,11 @@ tsqueryrecv(PG_FUNCTION_ARGS)
COMP_CRC32(valcrc, val, val_len); COMP_CRC32(valcrc, val, val_len);
FIN_CRC32(valcrc); FIN_CRC32(valcrc);
item->operand.weight = weight; item->qoperand.weight = weight;
item->operand.prefix = (prefix) ? true : false; item->qoperand.prefix = (prefix) ? true : false;
item->operand.valcrc = (int32) valcrc; item->qoperand.valcrc = (int32) valcrc;
item->operand.length = val_len; item->qoperand.length = val_len;
item->operand.distance = datalen; item->qoperand.distance = datalen;
/* /*
* Operand strings are copied to the final struct after this loop; * Operand strings are copied to the final struct after this loop;
@ -912,7 +912,7 @@ tsqueryrecv(PG_FUNCTION_ARGS)
if (i == size - 1) if (i == size - 1)
elog(ERROR, "invalid pointer to right operand"); elog(ERROR, "invalid pointer to right operand");
item->operator.oper = oper; item->qoperator.oper = oper;
} }
else else
elog(ERROR, "unrecognized tsquery node type: %d", item->type); elog(ERROR, "unrecognized tsquery node type: %d", item->type);
@ -936,8 +936,8 @@ tsqueryrecv(PG_FUNCTION_ARGS)
{ {
if (item->type == QI_VAL) if (item->type == QI_VAL)
{ {
memcpy(ptr, operands[i], item->operand.length + 1); memcpy(ptr, operands[i], item->qoperand.length + 1);
ptr += item->operand.length + 1; ptr += item->qoperand.length + 1;
} }
item++; item++;
} }

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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) if (in->type == QI_OPR)
{ {
node->right = maketree(in + 1); node->right = maketree(in + 1);
if (in->operator.oper != OP_NOT) if (in->qoperator.oper != OP_NOT)
node->left = maketree(in + in->operator.left); node->left = maketree(in + in->qoperator.left);
} }
return node; return node;
} }
@ -69,9 +69,9 @@ plainnode(PLAINTREE *state, NODE *node)
memcpy((void *) &(state->ptr[state->cur]), (void *) node->valnode, sizeof(QueryItem)); memcpy((void *) &(state->ptr[state->cur]), (void *) node->valnode, sizeof(QueryItem));
if (node->valnode->type == QI_VAL) if (node->valnode->type == QI_VAL)
state->cur++; 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++; state->cur++;
plainnode(state, node->right); plainnode(state, node->right);
} }
@ -81,7 +81,7 @@ plainnode(PLAINTREE *state, NODE *node)
state->cur++; state->cur++;
plainnode(state, node->right); plainnode(state, node->right);
state->ptr[cur].operator.left = state->cur - cur; state->ptr[cur].qoperator.left = state->cur - cur;
plainnode(state, node->left); plainnode(state, node->left);
} }
pfree(node); pfree(node);
@ -138,14 +138,14 @@ clean_NOT_intree(NODE *node)
if (node->valnode->type == QI_VAL) if (node->valnode->type == QI_VAL)
return node; return node;
if (node->valnode->operator.oper == OP_NOT) if (node->valnode->qoperator.oper == OP_NOT)
{ {
freetree(node); freetree(node);
return NULL; return NULL;
} }
/* operator & or | */ /* 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 || if ((node->left = clean_NOT_intree(node->left)) == NULL ||
(node->right = clean_NOT_intree(node->right)) == NULL) (node->right = clean_NOT_intree(node->right)) == NULL)
@ -158,7 +158,7 @@ clean_NOT_intree(NODE *node)
{ {
NODE *res = 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->left = clean_NOT_intree(node->left);
node->right = clean_NOT_intree(node->right); node->right = clean_NOT_intree(node->right);
@ -233,7 +233,7 @@ clean_fakeval_intree(NODE *node, char *result)
Assert(node->valnode->type == QI_OPR); 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); node->right = clean_fakeval_intree(node->right, &rresult);
if (!node->right) if (!node->right)

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 = (QueryItem *) palloc0(sizeof(QueryItem));
res->valnode->type = QI_OPR; res->valnode->type = QI_OPR;
res->valnode->operator.oper = operator; res->valnode->qoperator.oper = operator;
res->child = (QTNode **) palloc0(sizeof(QTNode *) * 2); res->child = (QTNode **) palloc0(sizeof(QTNode *) * 2);
res->child[0] = QT2QTN(GETQUERY(b), GETOPERAND(b)); 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 = (QueryItem *) palloc0(sizeof(QueryItem));
res->valnode->type = QI_OPR; 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 = (QTNode **) palloc0(sizeof(QTNode *));
res->child[0] = QT2QTN(GETQUERY(a), GETOPERAND(a)); res->child[0] = QT2QTN(GETQUERY(a), GETOPERAND(a));
@ -209,7 +209,7 @@ makeTSQuerySign(TSQuery a)
for (i = 0; i < a->size; i++) for (i = 0; i < a->size; i++)
{ {
if (ptr->type == QI_VAL) if (ptr->type == QI_VAL)
sign |= ((TSQuerySign) 1) << (ptr->operand.valcrc % TSQS_SIGLEN); sign |= ((TSQuerySign) 1) << (ptr->qoperand.valcrc % TSQS_SIGLEN);
ptr++; ptr++;
} }
@ -255,7 +255,7 @@ tsq_mcontains(PG_FUNCTION_ARGS)
if (ie[i].type != QI_VAL) if (ie[i].type != QI_VAL)
continue; continue;
for (j = 0; j < query->size; j++) 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; j = query->size + 1;
break; break;

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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->type == QI_OPR)
{ {
if (node->valnode->operator.oper != ex->valnode->operator.oper) if (node->valnode->qoperator.oper != ex->valnode->qoperator.oper)
return node; return node;
if (node->nchild == ex->nchild) if (node->nchild == ex->nchild)
@ -154,7 +154,7 @@ findeq(QTNode *node, QTNode *ex, QTNode *subs, bool *isfind)
{ {
Assert(node->valnode->type == QI_VAL); 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; return node;
else if (QTNEq(node, ex)) else if (QTNEq(node, ex))
{ {
@ -217,7 +217,7 @@ dropvoidsubtree(QTNode *root)
root->nchild = j; 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); QTNFree(root);
root = NULL; root = NULL;

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 = (QTNode **) palloc0(sizeof(QTNode *) * 2);
node->child[0] = QT2QTN(in + 1, operand); node->child[0] = QT2QTN(in + 1, operand);
node->sign = node->child[0]->sign; node->sign = node->child[0]->sign;
if (in->operator.oper == OP_NOT) if (in->qoperator.oper == OP_NOT)
node->nchild = 1; node->nchild = 1;
else else
{ {
node->nchild = 2; 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; node->sign |= node->child[1]->sign;
} }
} }
else if (operand) else if (operand)
{ {
node->word = operand + in->operand.distance; node->word = operand + in->qoperand.distance;
node->sign = 1 << (in->operand.valcrc % 32); node->sign = 1 << (in->qoperand.valcrc % 32);
} }
return node; return node;
@ -94,8 +94,8 @@ QTNodeCompare(QTNode *an, QTNode *bn)
if (an->valnode->type == QI_OPR) if (an->valnode->type == QI_OPR)
{ {
QueryOperator *ao = &an->valnode->operator; QueryOperator *ao = &an->valnode->qoperator;
QueryOperator *bo = &bn->valnode->operator; QueryOperator *bo = &bn->valnode->qoperator;
if (ao->oper != bo->oper) if (ao->oper != bo->oper)
return (ao->oper > bo->oper) ? -1 : 1; return (ao->oper > bo->oper) ? -1 : 1;
@ -115,8 +115,8 @@ QTNodeCompare(QTNode *an, QTNode *bn)
} }
else else
{ {
QueryOperand *ao = &an->valnode->operand; QueryOperand *ao = &an->valnode->qoperand;
QueryOperand *bo = &bn->valnode->operand; QueryOperand *bo = &bn->valnode->qoperand;
Assert(an->valnode->type == QI_VAL); Assert(an->valnode->type == QI_VAL);
@ -188,7 +188,7 @@ QTNTernary(QTNode *in)
{ {
QTNode *cc = in->child[i]; 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; int oldnchild = in->nchild;
@ -245,7 +245,7 @@ QTNBinary(QTNode *in)
nn->sign = nn->child[0]->sign | nn->child[1]->sign; nn->sign = nn->child[0]->sign | nn->child[1]->sign;
nn->valnode->type = in->valnode->type; 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[0] = nn;
in->child[1] = in->child[in->nchild - 1]; in->child[1] = in->child[in->nchild - 1];
@ -273,7 +273,7 @@ cntsize(QTNode *in, int *sumlen, int *nnode)
} }
else 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->curitem, in->valnode, sizeof(QueryOperand));
memcpy(state->curoperand, in->word, in->valnode->operand.length); memcpy(state->curoperand, in->word, in->valnode->qoperand.length);
state->curitem->operand.distance = state->curoperand - state->operand; state->curitem->qoperand.distance = state->curoperand - state->operand;
state->curoperand[in->valnode->operand.length] = '\0'; state->curoperand[in->valnode->qoperand.length] = '\0';
state->curoperand += in->valnode->operand.length + 1; state->curoperand += in->valnode->qoperand.length + 1;
state->curitem++; state->curitem++;
} }
else else
@ -315,7 +315,7 @@ fillQT(QTN2QTState *state, QTNode *in)
if (in->nchild == 2) if (in->nchild == 2)
{ {
curitem->operator.left = state->curitem - curitem; curitem->qoperator.left = state->curitem - curitem;
fillQT(state, in->child[1]); fillQT(state, in->child[1]);
} }
} }
@ -361,9 +361,9 @@ QTNCopy(QTNode *in)
if (in->valnode->type == QI_VAL) if (in->valnode->type == QI_VAL)
{ {
out->word = palloc(in->valnode->operand.length + 1); out->word = palloc(in->valnode->qoperand.length + 1);
memcpy(out->word, in->word, in->valnode->operand.length); memcpy(out->word, in->word, in->valnode->qoperand.length);
out->word[in->valnode->operand.length] = '\0'; out->word[in->valnode->qoperand.length] = '\0';
out->flags |= QTN_WORDFREE; out->flags |= QTN_WORDFREE;
} }
else else

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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; return 0.0;
/* XXX: What about NOT? */ /* 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); calc_rank_and(w, t, q) : calc_rank_or(w, t, q);
if (res < 0) if (res < 0)
@ -641,7 +641,7 @@ get_docrep(TSVector txt, QueryRepresentation *qr, int *doclen)
if (item[i].type != QI_VAL) if (item[i].type != QI_VAL)
continue; continue;
curoperand = &item[i].operand; curoperand = &item[i].qoperand;
if (QR_GET_OPERAND_EXISTS(qr, &item[i])) if (QR_GET_OPERAND_EXISTS(qr, &item[i]))
continue; continue;
@ -680,8 +680,8 @@ get_docrep(TSVector txt, QueryRepresentation *qr, int *doclen)
for (k = 0; k < qr->query->size; k++) for (k = 0; k < qr->query->size; k++)
{ {
QueryOperand *kptr = &item[k].operand; QueryOperand *kptr = &item[k].qoperand;
QueryOperand *iptr = &item[i].operand; QueryOperand *iptr = &item[i].qoperand;
if (k == i || if (k == i ||
(item[k].type == QI_VAL && (item[k].type == QI_VAL &&

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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) if (curitem->type == QI_VAL)
return chkcond(checkval, (QueryOperand *) curitem); return chkcond(checkval, (QueryOperand *) curitem);
switch (curitem->operator.oper) switch (curitem->qoperator.oper)
{ {
case OP_NOT: case OP_NOT:
if (calcnot) if (calcnot)
@ -676,19 +676,19 @@ TS_execute(QueryItem *curitem, void *checkval, bool calcnot,
else else
return true; return true;
case OP_AND: 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); return TS_execute(curitem + 1, checkval, calcnot, chkcond);
else else
return false; return false;
case OP_OR: 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; return true;
else else
return TS_execute(curitem + 1, checkval, calcnot, chkcond); return TS_execute(curitem + 1, checkval, calcnot, chkcond);
default: default:
elog(ERROR, "unrecognized operator: %d", curitem->operator.oper); elog(ERROR, "unrecognized operator: %d", curitem->qoperator.oper);
} }
/* not reachable, but keep compiler quiet */ /* not reachable, but keep compiler quiet */

View File

@ -10,7 +10,7 @@
* Written by Peter Eisentraut <peter_e@gmx.net>. * Written by Peter Eisentraut <peter_e@gmx.net>.
* *
* IDENTIFICATION * 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); Node *arg = (Node *) lfirst(l);
char *val; char *val;
TypeName *typename = NULL; TypeName *typeName = NULL;
A_Const *con; A_Const *con;
if (l != list_head(args)) if (l != list_head(args))
@ -5342,7 +5342,7 @@ flatten_set_variable_args(const char *name, List *args)
TypeCast *tc = (TypeCast *) arg; TypeCast *tc = (TypeCast *) arg;
arg = tc->arg; arg = tc->arg;
typename = tc->typename; typeName = tc->typeName;
} }
if (!IsA(arg, A_Const)) if (!IsA(arg, A_Const))
@ -5360,7 +5360,7 @@ flatten_set_variable_args(const char *name, List *args)
break; break;
case T_String: case T_String:
val = strVal(&con->val); val = strVal(&con->val);
if (typename != NULL) if (typeName != NULL)
{ {
/* /*
* Must be a ConstInterval argument for TIME ZONE. Coerce * Must be a ConstInterval argument for TIME ZONE. Coerce
@ -5372,7 +5372,7 @@ flatten_set_variable_args(const char *name, List *args)
Datum interval; Datum interval;
char *intervalout; char *intervalout;
typoid = typenameTypeId(NULL, typename, &typmod); typoid = typenameTypeId(NULL, typeName, &typmod);
Assert(typoid == INTERVALOID); Assert(typoid == INTERVALOID);
interval = interval =

View File

@ -14,7 +14,7 @@
* *
* *
* IDENTIFICATION * 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); pfree(context);
} }

View File

@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * 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 * NOTES
* the genbki.sh script reads this file and generates .bki * 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, extern bool ConstraintNameIsUsed(ConstraintCategory conCat, Oid objId,
Oid objNamespace, const char *conname); Oid objNamespace, const char *conname);
extern char *ChooseConstraintName(const char *name1, const char *name2, extern char *ChooseConstraintName(const char *name1, const char *name2,
const char *label, Oid namespace, const char *label, Oid namespaceid,
List *others); List *others);
extern void AlterConstraintNamespaces(Oid ownerId, Oid oldNspId, extern void AlterConstraintNamespaces(Oid ownerId, Oid oldNspId,

View File

@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * 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, extern char *makeObjectName(const char *name1, const char *name2,
const char *label); const char *label);
extern char *ChooseRelationName(const char *name1, const char *name2, 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); extern Oid GetDefaultOpClass(Oid type_id, Oid am_id);
/* commands/functioncmds.c */ /* commands/functioncmds.c */

View File

@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * 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 *origTblName,
const char *origTypeName); 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 AttrNumber *varattnos_map_schema(TupleDesc old, List *schema);
extern void change_varattnos_of_a_node(Node *node, const AttrNumber *newattno); extern void change_varattnos_of_a_node(Node *node, const AttrNumber *newattno);

View File

@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * 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 *makeTypeName(char *typnam);
extern TypeName *makeTypeNameFromNameList(List *names); 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, extern FuncExpr *makeFuncExpr(Oid funcid, Oid rettype,
List *args, CoercionForm fformat); List *args, CoercionForm fformat);
extern DefElem *makeDefElem(char *name, Node *arg); 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); DefElemAction defaction);
#endif /* MAKEFUNC_H */ #endif /* MAKEFUNC_H */

View File

@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * 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 *(*realloc) (MemoryContext context, void *pointer, Size size);
void (*init) (MemoryContext context); void (*init) (MemoryContext context);
void (*reset) (MemoryContext context); void (*reset) (MemoryContext context);
void (*delete) (MemoryContext context); void (*delete_context) (MemoryContext context);
Size (*get_chunk_space) (MemoryContext context, void *pointer); Size (*get_chunk_space) (MemoryContext context, void *pointer);
bool (*is_empty) (MemoryContext context); bool (*is_empty) (MemoryContext context);
void (*stats) (MemoryContext context, int level); void (*stats) (MemoryContext context, int level);

View File

@ -13,7 +13,7 @@
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * 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 * For TypeName structures generated internally, it is often easier to
* specify the type by OID than by name. If "names" is NIL then the * 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 * Similarly, if "typmods" is NIL then the actual typmod is expected to
* be prespecified in typemod, otherwise typemod is unused. * be prespecified in typemod, otherwise typemod is unused.
* *
@ -173,7 +173,7 @@ typedef struct TypeName
{ {
NodeTag type; NodeTag type;
List *names; /* qualified name (list of Value strings) */ 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 setof; /* is a set? */
bool pct_type; /* %TYPE specified? */ bool pct_type; /* %TYPE specified? */
List *typmods; /* type modifier expression(s) */ List *typmods; /* type modifier expression(s) */
@ -256,7 +256,7 @@ typedef struct TypeCast
{ {
NodeTag type; NodeTag type;
Node *arg; /* the expression being casted */ Node *arg; /* the expression being casted */
TypeName *typename; /* the target type */ TypeName *typeName; /* the target type */
int location; /* token location, or -1 if unknown */ int location; /* token location, or -1 if unknown */
} TypeCast; } TypeCast;
@ -457,7 +457,7 @@ typedef struct ColumnDef
{ {
NodeTag type; NodeTag type;
char *colname; /* name of column */ char *colname; /* name of column */
TypeName *typename; /* type of column */ TypeName *typeName; /* type of column */
int inhcount; /* number of times column is inherited */ int inhcount; /* number of times column is inherited */
bool is_local; /* column has local (non-inherited) def'n */ bool is_local; /* column has local (non-inherited) def'n */
bool is_not_null; /* NOT NULL constraint specified? */ bool is_not_null; /* NOT NULL constraint specified? */
@ -554,7 +554,7 @@ typedef struct XmlSerialize
NodeTag type; NodeTag type;
XmlOptionType xmloption; /* DOCUMENT or CONTENT */ XmlOptionType xmloption; /* DOCUMENT or CONTENT */
Node *expr; Node *expr;
TypeName *typename; TypeName *typeName;
int location; /* token location, or -1 if unknown */ int location; /* token location, or -1 if unknown */
} XmlSerialize; } XmlSerialize;
@ -1166,7 +1166,7 @@ typedef struct AlterDomainStmt
* X = drop constraint * X = drop constraint
*------------ *------------
*/ */
List *typename; /* domain to work on */ List *typeName; /* domain to work on */
char *name; /* column or constraint name to act on */ char *name; /* column or constraint name to act on */
Node *def; /* definition of default or constraint */ Node *def; /* definition of default or constraint */
DropBehavior behavior; /* RESTRICT or CASCADE for DROP cases */ DropBehavior behavior; /* RESTRICT or CASCADE for DROP cases */
@ -1670,7 +1670,7 @@ typedef struct CreateDomainStmt
{ {
NodeTag type; NodeTag type;
List *domainname; /* qualified name (list of Value strings) */ 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) */ List *constraints; /* constraints (list of Constraint nodes) */
} CreateDomainStmt; } CreateDomainStmt;
@ -2084,7 +2084,7 @@ typedef struct CompositeTypeStmt
typedef struct CreateEnumStmt typedef struct CreateEnumStmt
{ {
NodeTag type; 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) */ List *vals; /* enum values (list of Value strings) */
} CreateEnumStmt; } CreateEnumStmt;

View File

@ -10,7 +10,7 @@
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * 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 * JoinExpr - for SQL JOIN expressions
* *
* isNatural, using, and quals are interdependent. The user can write only * isNatural, usingClause, and quals are interdependent. The user can write
* one of NATURAL, USING(), or ON() (this is enforced by the grammar). * only one of NATURAL, USING(), or ON() (this is enforced by the grammar).
* If he writes NATURAL then parse analysis generates the equivalent USING() * If he writes NATURAL then parse analysis generates the equivalent USING()
* list, and from that fills in "quals" with the right equality comparisons. * list, and from that fills in "quals" with the right equality comparisons.
* If he writes USING() then "quals" is filled with 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 */ bool isNatural; /* Natural join? Will need to shape table */
Node *larg; /* left subtree */ Node *larg; /* left subtree */
Node *rarg; /* right 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 */ Node *quals; /* qualifiers on join, if any */
Alias *alias; /* user-written alias clause, if any */ Alias *alias; /* user-written alias clause, if any */
int rtindex; /* RT index assigned for join, or 0 */ int rtindex; /* RT index assigned for join, or 0 */

View File

@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * 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 bool has_unique_index(RelOptInfo *rel, AttrNumber attno);
extern Selectivity restriction_selectivity(PlannerInfo *root, extern Selectivity restriction_selectivity(PlannerInfo *root,
Oid operator, Oid operatorid,
List *args, List *args,
int varRelid); int varRelid);
extern Selectivity join_selectivity(PlannerInfo *root, extern Selectivity join_selectivity(PlannerInfo *root,
Oid operator, Oid operatorid,
List *args, List *args,
JoinType jointype, JoinType jointype,
SpecialJoinInfo *sjinfo); SpecialJoinInfo *sjinfo);

View File

@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * 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 $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -19,14 +19,14 @@
typedef HeapTuple Type; typedef HeapTuple Type;
extern Type LookupTypeName(ParseState *pstate, const TypeName *typename, extern Type LookupTypeName(ParseState *pstate, const TypeName *typeName,
int32 *typmod_p); int32 *typmod_p);
extern Type typenameType(ParseState *pstate, const TypeName *typename, extern Type typenameType(ParseState *pstate, const TypeName *typeName,
int32 *typmod_p); int32 *typmod_p);
extern Oid typenameTypeId(ParseState *pstate, const TypeName *typename, extern Oid typenameTypeId(ParseState *pstate, const TypeName *typeName,
int32 *typmod_p); int32 *typmod_p);
extern char *TypeNameToString(const TypeName *typename); extern char *TypeNameToString(const TypeName *typeName);
extern char *TypeNameListToString(List *typenames); extern char *TypeNameListToString(List *typenames);
extern Type typeidType(Oid id); extern Type typeidType(Oid id);

View File

@ -6,7 +6,7 @@
* *
* Copyright (c) 1998-2009, PostgreSQL Global Development Group * 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 bool isend; /* in: marks for lexize_info about text end is
* reached */ * reached */
bool getnext; /* out: dict wants next lexeme */ 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 */ * getnext == true */
} DictSubState; } DictSubState;

View File

@ -5,7 +5,7 @@
* *
* Copyright (c) 1998-2009, PostgreSQL Global Development Group * 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 typedef union
{ {
QueryItemType type; QueryItemType type;
QueryOperator operator; QueryOperator qoperator;
QueryOperand operand; QueryOperand qoperand;
} QueryItem; } QueryItem;
/* /*

View File

@ -5,7 +5,7 @@
* *
* Copyright (c) 1998-2009, PostgreSQL Global Development Group * 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, extern void pushValue(TSQueryParserState state,
char *strval, int lenval, int2 weight, bool prefix); char *strval, int lenval, int2 weight, bool prefix);
extern void pushStop(TSQueryParserState state); 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 * parse plain text and lexize words

View File

@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * 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, extern List *deparse_context_for_plan(Node *plan, Node *outer_plan,
List *rtable, List *subplans); List *rtable, List *subplans);
extern const char *quote_identifier(const char *ident); 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); const char *ident);
/* tid.c */ /* tid.c */

View File

@ -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