*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/common/tupdesc.c,v 1.126 2009/06/11 14:48:53 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/access/common/tupdesc.c,v 1.127 2009/07/16 06:33:42 petere Exp $
*
* NOTES
* some of the executor utility code such as "ExecTypeFromTL" should be
attnum++;
attname = entry->colname;
- atttypid = typenameTypeId(NULL, entry->typename, &atttypmod);
- attdim = list_length(entry->typename->arrayBounds);
+ atttypid = typenameTypeId(NULL, entry->typeName, &atttypmod);
+ attdim = list_length(entry->typeName->arrayBounds);
- if (entry->typename->setof)
+ if (entry->typeName->setof)
ereport(ERROR,
(errcode(ERRCODE_INVALID_TABLE_DEFINITION),
errmsg("column \"%s\" cannot be declared SETOF",
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
*/
char *
ChooseConstraintName(const char *name1, const char *name2,
- const char *label, Oid namespace,
+ const char *label, Oid namespaceid,
List *others)
{
int pass = 0;
ScanKeyInit(&skey[1],
Anum_pg_constraint_connamespace,
BTEqualStrategyNumber, F_OIDEQ,
- ObjectIdGetDatum(namespace));
+ ObjectIdGetDatum(namespaceid));
conscan = systable_beginscan(conDesc, ConstraintNameNspIndexId, true,
SnapshotNow, 2, skey);
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
*/
char *
ChooseRelationName(const char *name1, const char *name2,
- const char *label, Oid namespace)
+ const char *label, Oid namespaceid)
{
int pass = 0;
char *relname = NULL;
{
relname = makeObjectName(name1, name2, modlabel);
- if (!OidIsValid(get_relname_relid(relname, namespace)))
+ if (!OidIsValid(get_relname_relid(relname, namespaceid)))
break;
/* found a conflict, so try a new name component */
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
switch (i)
{
case SEQ_COL_NAME:
- coldef->typename = makeTypeNameFromOid(NAMEOID, -1);
+ coldef->typeName = makeTypeNameFromOid(NAMEOID, -1);
coldef->colname = "sequence_name";
namestrcpy(&name, seq->sequence->relname);
value[i - 1] = NameGetDatum(&name);
break;
case SEQ_COL_LASTVAL:
- coldef->typename = makeTypeNameFromOid(INT8OID, -1);
+ coldef->typeName = makeTypeNameFromOid(INT8OID, -1);
coldef->colname = "last_value";
value[i - 1] = Int64GetDatumFast(new.last_value);
break;
case SEQ_COL_STARTVAL:
- coldef->typename = makeTypeNameFromOid(INT8OID, -1);
+ coldef->typeName = makeTypeNameFromOid(INT8OID, -1);
coldef->colname = "start_value";
value[i - 1] = Int64GetDatumFast(new.start_value);
break;
case SEQ_COL_INCBY:
- coldef->typename = makeTypeNameFromOid(INT8OID, -1);
+ coldef->typeName = makeTypeNameFromOid(INT8OID, -1);
coldef->colname = "increment_by";
value[i - 1] = Int64GetDatumFast(new.increment_by);
break;
case SEQ_COL_MAXVALUE:
- coldef->typename = makeTypeNameFromOid(INT8OID, -1);
+ coldef->typeName = makeTypeNameFromOid(INT8OID, -1);
coldef->colname = "max_value";
value[i - 1] = Int64GetDatumFast(new.max_value);
break;
case SEQ_COL_MINVALUE:
- coldef->typename = makeTypeNameFromOid(INT8OID, -1);
+ coldef->typeName = makeTypeNameFromOid(INT8OID, -1);
coldef->colname = "min_value";
value[i - 1] = Int64GetDatumFast(new.min_value);
break;
case SEQ_COL_CACHE:
- coldef->typename = makeTypeNameFromOid(INT8OID, -1);
+ coldef->typeName = makeTypeNameFromOid(INT8OID, -1);
coldef->colname = "cache_value";
value[i - 1] = Int64GetDatumFast(new.cache_value);
break;
case SEQ_COL_LOG:
- coldef->typename = makeTypeNameFromOid(INT8OID, -1);
+ coldef->typeName = makeTypeNameFromOid(INT8OID, -1);
coldef->colname = "log_cnt";
value[i - 1] = Int64GetDatum((int64) 1);
break;
case SEQ_COL_CYCLE:
- coldef->typename = makeTypeNameFromOid(BOOLOID, -1);
+ coldef->typeName = makeTypeNameFromOid(BOOLOID, -1);
coldef->colname = "is_cycled";
value[i - 1] = BoolGetDatum(new.is_cycled);
break;
case SEQ_COL_CALLED:
- coldef->typename = makeTypeNameFromOid(BOOLOID, -1);
+ coldef->typeName = makeTypeNameFromOid(BOOLOID, -1);
coldef->colname = "is_called";
value[i - 1] = BoolGetDatum(false);
break;
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
bool recurse, bool recursing,
AlterTableCmd *cmd);
static void ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
- const char *colName, TypeName *typename);
+ const char *colName, TypeName *typeName);
static void ATPostAlterTypeCleanup(List **wqueue, AlteredTableInfo *tab);
static void ATPostAlterTypeParse(char *cmd, List **wqueue);
static void change_owner_recurse_to_sequences(Oid relationOid,
(errmsg("merging multiple inherited definitions of column \"%s\"",
attributeName)));
def = (ColumnDef *) list_nth(inhSchema, exist_attno - 1);
- defTypeId = typenameTypeId(NULL, def->typename, &deftypmod);
+ defTypeId = typenameTypeId(NULL, def->typeName, &deftypmod);
if (defTypeId != attribute->atttypid ||
deftypmod != attribute->atttypmod)
ereport(ERROR,
errmsg("inherited column \"%s\" has a type conflict",
attributeName),
errdetail("%s versus %s",
- TypeNameToString(def->typename),
+ TypeNameToString(def->typeName),
format_type_be(attribute->atttypid))));
def->inhcount++;
/* Merge of NOT NULL constraints = OR 'em together */
*/
def = makeNode(ColumnDef);
def->colname = pstrdup(attributeName);
- def->typename = makeTypeNameFromOid(attribute->atttypid,
+ def->typeName = makeTypeNameFromOid(attribute->atttypid,
attribute->atttypmod);
def->inhcount = 1;
def->is_local = false;
(errmsg("merging column \"%s\" with inherited definition",
attributeName)));
def = (ColumnDef *) list_nth(inhSchema, exist_attno - 1);
- defTypeId = typenameTypeId(NULL, def->typename, &deftypmod);
- newTypeId = typenameTypeId(NULL, newdef->typename, &newtypmod);
+ defTypeId = typenameTypeId(NULL, def->typeName, &deftypmod);
+ newTypeId = typenameTypeId(NULL, newdef->typeName, &newtypmod);
if (defTypeId != newTypeId || deftypmod != newtypmod)
ereport(ERROR,
(errcode(ERRCODE_DATATYPE_MISMATCH),
errmsg("column \"%s\" has a type conflict",
attributeName),
errdetail("%s versus %s",
- TypeNameToString(def->typename),
- TypeNameToString(newdef->typename))));
+ TypeNameToString(def->typeName),
+ TypeNameToString(newdef->typeName))));
/* Mark the column as locally defined */
def->is_local = true;
/* Merge of NOT NULL constraints = OR 'em together */
* matching according to column name.
*/
AttrNumber *
-varattnos_map(TupleDesc old, TupleDesc new)
+varattnos_map(TupleDesc olddesc, TupleDesc newdesc)
{
AttrNumber *attmap;
int i,
j;
- attmap = (AttrNumber *) palloc0(sizeof(AttrNumber) * old->natts);
- for (i = 1; i <= old->natts; i++)
+ attmap = (AttrNumber *) palloc0(sizeof(AttrNumber) * olddesc->natts);
+ for (i = 1; i <= olddesc->natts; i++)
{
- if (old->attrs[i - 1]->attisdropped)
+ if (olddesc->attrs[i - 1]->attisdropped)
continue; /* leave the entry as zero */
- for (j = 1; j <= new->natts; j++)
+ for (j = 1; j <= newdesc->natts; j++)
{
- if (strcmp(NameStr(old->attrs[i - 1]->attname),
- NameStr(new->attrs[j - 1]->attname)) == 0)
+ if (strcmp(NameStr(olddesc->attrs[i - 1]->attname),
+ NameStr(newdesc->attrs[j - 1]->attname)) == 0)
{
attmap[i - 1] = j;
break;
int32 ctypmod;
/* Child column must match by type */
- ctypeId = typenameTypeId(NULL, colDef->typename, &ctypmod);
+ ctypeId = typenameTypeId(NULL, colDef->typeName, &ctypmod);
if (ctypeId != childatt->atttypid ||
ctypmod != childatt->atttypmod)
ereport(ERROR,
MaxHeapAttributeNumber)));
}
- typeTuple = typenameType(NULL, colDef->typename, &typmod);
+ typeTuple = typenameType(NULL, colDef->typeName, &typmod);
tform = (Form_pg_type) GETSTRUCT(typeTuple);
typeOid = HeapTupleGetOid(typeTuple);
attribute.atttypmod = typmod;
attribute.attnum = newattnum;
attribute.attbyval = tform->typbyval;
- attribute.attndims = list_length(colDef->typename->arrayBounds);
+ attribute.attndims = list_length(colDef->typeName->arrayBounds);
attribute.attstorage = tform->typstorage;
attribute.attalign = tform->typalign;
attribute.attnotnull = colDef->is_not_null;
ColumnDef *cdef = makeNode(ColumnDef);
cdef->colname = pstrdup("oid");
- cdef->typename = makeTypeNameFromOid(OIDOID, -1);
+ cdef->typeName = makeTypeNameFromOid(OIDOID, -1);
cdef->inhcount = 0;
cdef->is_local = true;
cdef->is_not_null = true;
AlterTableCmd *cmd)
{
char *colName = cmd->name;
- TypeName *typename = (TypeName *) cmd->def;
+ TypeName *typeName = (TypeName *) cmd->def;
HeapTuple tuple;
Form_pg_attribute attTup;
AttrNumber attnum;
colName)));
/* Look up the target type */
- targettype = typenameTypeId(NULL, typename, &targettypmod);
+ targettype = typenameTypeId(NULL, typeName, &targettypmod);
/* make sure datatype is legal for a column */
CheckAttributeType(colName, targettype);
static void
ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
- const char *colName, TypeName *typename)
+ const char *colName, TypeName *typeName)
{
HeapTuple heapTup;
Form_pg_attribute attTup;
colName)));
/* Look up the target type (should not fail, since prep found it) */
- typeTuple = typenameType(NULL, typename, &targettypmod);
+ typeTuple = typenameType(NULL, typeName, &targettypmod);
tform = (Form_pg_type) GETSTRUCT(typeTuple);
targettype = HeapTupleGetOid(typeTuple);
*/
attTup->atttypid = targettype;
attTup->atttypmod = targettypmod;
- attTup->attndims = list_length(typename->arrayBounds);
+ attTup->attndims = list_length(typeName->arrayBounds);
attTup->attlen = tform->typlen;
attTup->attbyval = tform->typbyval;
attTup->attalign = tform->typalign;
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/typecmds.c,v 1.134 2009/06/11 14:48:56 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/typecmds.c,v 1.135 2009/07/16 06:33:42 petere Exp $
*
* DESCRIPTION
* The "DefineFoo" routines take the parse tree and pick out the
bool saw_default = false;
bool typNotNull = false;
bool nullDefined = false;
- int32 typNDims = list_length(stmt->typename->arrayBounds);
+ int32 typNDims = list_length(stmt->typeName->arrayBounds);
HeapTuple typeTup;
List *schema = stmt->constraints;
ListCell *listptr;
/*
* Look up the base type.
*/
- typeTup = typenameType(NULL, stmt->typename, &basetypeMod);
+ typeTup = typenameType(NULL, stmt->typeName, &basetypeMod);
baseType = (Form_pg_type) GETSTRUCT(typeTup);
basetypeoid = HeapTupleGetOid(typeTup);
ereport(ERROR,
(errcode(ERRCODE_DATATYPE_MISMATCH),
errmsg("\"%s\" is not a valid base type for a domain",
- TypeNameToString(stmt->typename))));
+ TypeNameToString(stmt->typeName))));
/* passed by value */
byValue = baseType->typbyval;
Relation pg_type;
/* Convert list of names to a name and namespace */
- enumNamespace = QualifiedNameGetCreationNamespace(stmt->typename,
+ enumNamespace = QualifiedNameGetCreationNamespace(stmt->typeName,
&enumName);
/* Check we have creation rights in target namespace */
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
ColumnDef *def = makeNode(ColumnDef);
def->colname = pstrdup(tle->resname);
- def->typename = makeTypeNameFromOid(exprType((Node *) tle->expr),
+ def->typeName = makeTypeNameFromOid(exprType((Node *) tle->expr),
exprTypmod((Node *) tle->expr));
def->inhcount = 0;
def->is_local = true;
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.432 2009/06/18 01:27:02 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.433 2009/07/16 06:33:42 petere Exp $
*
*-------------------------------------------------------------------------
*/
COPY_SCALAR_FIELD(isNatural);
COPY_NODE_FIELD(larg);
COPY_NODE_FIELD(rarg);
- COPY_NODE_FIELD(using);
+ COPY_NODE_FIELD(usingClause);
COPY_NODE_FIELD(quals);
COPY_NODE_FIELD(alias);
COPY_SCALAR_FIELD(rtindex);
TypeName *newnode = makeNode(TypeName);
COPY_NODE_FIELD(names);
- COPY_SCALAR_FIELD(typeid);
+ COPY_SCALAR_FIELD(typeOid);
COPY_SCALAR_FIELD(setof);
COPY_SCALAR_FIELD(pct_type);
COPY_NODE_FIELD(typmods);
TypeCast *newnode = makeNode(TypeCast);
COPY_NODE_FIELD(arg);
- COPY_NODE_FIELD(typename);
+ COPY_NODE_FIELD(typeName);
COPY_LOCATION_FIELD(location);
return newnode;
ColumnDef *newnode = makeNode(ColumnDef);
COPY_STRING_FIELD(colname);
- COPY_NODE_FIELD(typename);
+ COPY_NODE_FIELD(typeName);
COPY_SCALAR_FIELD(inhcount);
COPY_SCALAR_FIELD(is_local);
COPY_SCALAR_FIELD(is_not_null);
COPY_SCALAR_FIELD(xmloption);
COPY_NODE_FIELD(expr);
- COPY_NODE_FIELD(typename);
+ COPY_NODE_FIELD(typeName);
COPY_LOCATION_FIELD(location);
return newnode;
AlterDomainStmt *newnode = makeNode(AlterDomainStmt);
COPY_SCALAR_FIELD(subtype);
- COPY_NODE_FIELD(typename);
+ COPY_NODE_FIELD(typeName);
COPY_STRING_FIELD(name);
COPY_NODE_FIELD(def);
COPY_SCALAR_FIELD(behavior);
{
CreateEnumStmt *newnode = makeNode(CreateEnumStmt);
- COPY_NODE_FIELD(typename);
+ COPY_NODE_FIELD(typeName);
COPY_NODE_FIELD(vals);
return newnode;
CreateDomainStmt *newnode = makeNode(CreateDomainStmt);
COPY_NODE_FIELD(domainname);
- COPY_NODE_FIELD(typename);
+ COPY_NODE_FIELD(typeName);
COPY_NODE_FIELD(constraints);
return newnode;
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.355 2009/06/18 01:27:02 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.356 2009/07/16 06:33:42 petere Exp $
*
*-------------------------------------------------------------------------
*/
COMPARE_SCALAR_FIELD(isNatural);
COMPARE_NODE_FIELD(larg);
COMPARE_NODE_FIELD(rarg);
- COMPARE_NODE_FIELD(using);
+ COMPARE_NODE_FIELD(usingClause);
COMPARE_NODE_FIELD(quals);
COMPARE_NODE_FIELD(alias);
COMPARE_SCALAR_FIELD(rtindex);
_equalAlterDomainStmt(AlterDomainStmt *a, AlterDomainStmt *b)
{
COMPARE_SCALAR_FIELD(subtype);
- COMPARE_NODE_FIELD(typename);
+ COMPARE_NODE_FIELD(typeName);
COMPARE_STRING_FIELD(name);
COMPARE_NODE_FIELD(def);
COMPARE_SCALAR_FIELD(behavior);
static bool
_equalCreateEnumStmt(CreateEnumStmt *a, CreateEnumStmt *b)
{
- COMPARE_NODE_FIELD(typename);
+ COMPARE_NODE_FIELD(typeName);
COMPARE_NODE_FIELD(vals);
return true;
_equalCreateDomainStmt(CreateDomainStmt *a, CreateDomainStmt *b)
{
COMPARE_NODE_FIELD(domainname);
- COMPARE_NODE_FIELD(typename);
+ COMPARE_NODE_FIELD(typeName);
COMPARE_NODE_FIELD(constraints);
return true;
_equalTypeName(TypeName *a, TypeName *b)
{
COMPARE_NODE_FIELD(names);
- COMPARE_SCALAR_FIELD(typeid);
+ COMPARE_SCALAR_FIELD(typeOid);
COMPARE_SCALAR_FIELD(setof);
COMPARE_SCALAR_FIELD(pct_type);
COMPARE_NODE_FIELD(typmods);
_equalTypeCast(TypeCast *a, TypeCast *b)
{
COMPARE_NODE_FIELD(arg);
- COMPARE_NODE_FIELD(typename);
+ COMPARE_NODE_FIELD(typeName);
COMPARE_LOCATION_FIELD(location);
return true;
_equalColumnDef(ColumnDef *a, ColumnDef *b)
{
COMPARE_STRING_FIELD(colname);
- COMPARE_NODE_FIELD(typename);
+ COMPARE_NODE_FIELD(typeName);
COMPARE_SCALAR_FIELD(inhcount);
COMPARE_SCALAR_FIELD(is_local);
COMPARE_SCALAR_FIELD(is_not_null);
{
COMPARE_SCALAR_FIELD(xmloption);
COMPARE_NODE_FIELD(expr);
- COMPARE_NODE_FIELD(typename);
+ COMPARE_NODE_FIELD(typeName);
COMPARE_LOCATION_FIELD(location);
return true;
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
* build a TypeName node to represent a type already known by OID/typmod.
*/
TypeName *
-makeTypeNameFromOid(Oid typeid, int32 typmod)
+makeTypeNameFromOid(Oid typeOid, int32 typmod)
{
TypeName *n = makeNode(TypeName);
- n->typeid = typeid;
+ n->typeOid = typeOid;
n->typemod = typmod;
n->location = -1;
return n;
* build a DefElem node with all fields available to be specified
*/
DefElem *
-makeDefElemExtended(char *namespace, char *name, Node *arg,
+makeDefElemExtended(char *nameSpace, char *name, Node *arg,
DefElemAction defaction)
{
DefElem *res = makeNode(DefElem);
- res->defnamespace = namespace;
+ res->defnamespace = nameSpace;
res->defname = name;
res->arg = arg;
res->defaction = defaction;
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
* any of the components might be leftmost.
*/
loc = exprLocation(tc->arg);
- loc = leftmostLoc(loc, tc->typename->location);
+ loc = leftmostLoc(loc, tc->typeName->location);
loc = leftmostLoc(loc, tc->location);
}
break;
if (walker(tc->arg, context))
return true;
- if (walker(tc->typename, context))
+ if (walker(tc->typeName, context))
return true;
}
break;
{
ColumnDef *coldef = (ColumnDef *) node;
- if (walker(coldef->typename, context))
+ if (walker(coldef->typeName, context))
return true;
if (walker(coldef->raw_default, context))
return true;
if (walker(xs->expr, context))
return true;
- if (walker(xs->typename, context))
+ if (walker(xs->typeName, context))
return true;
}
break;
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.360 2009/06/11 14:48:58 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.361 2009/07/16 06:33:42 petere Exp $
*
* NOTES
* Every node type that can appear in stored rules' parsetrees *must*
WRITE_BOOL_FIELD(isNatural);
WRITE_NODE_FIELD(larg);
WRITE_NODE_FIELD(rarg);
- WRITE_NODE_FIELD(using);
+ WRITE_NODE_FIELD(usingClause);
WRITE_NODE_FIELD(quals);
WRITE_NODE_FIELD(alias);
WRITE_INT_FIELD(rtindex);
WRITE_ENUM_FIELD(xmloption, XmlOptionType);
WRITE_NODE_FIELD(expr);
- WRITE_NODE_FIELD(typename);
+ WRITE_NODE_FIELD(typeName);
WRITE_LOCATION_FIELD(location);
}
WRITE_NODE_TYPE("COLUMNDEF");
WRITE_STRING_FIELD(colname);
- WRITE_NODE_FIELD(typename);
+ WRITE_NODE_FIELD(typeName);
WRITE_INT_FIELD(inhcount);
WRITE_BOOL_FIELD(is_local);
WRITE_BOOL_FIELD(is_not_null);
WRITE_NODE_TYPE("TYPENAME");
WRITE_NODE_FIELD(names);
- WRITE_OID_FIELD(typeid);
+ WRITE_OID_FIELD(typeOid);
WRITE_BOOL_FIELD(setof);
WRITE_BOOL_FIELD(pct_type);
WRITE_NODE_FIELD(typmods);
WRITE_NODE_TYPE("TYPECAST");
WRITE_NODE_FIELD(arg);
- WRITE_NODE_FIELD(typename);
+ WRITE_NODE_FIELD(typeName);
WRITE_LOCATION_FIELD(location);
}
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/nodes/readfuncs.c,v 1.222 2009/06/11 14:48:58 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/nodes/readfuncs.c,v 1.223 2009/07/16 06:33:42 petere Exp $
*
* NOTES
* Path and Plan nodes do not have any readfuncs support, because we
READ_BOOL_FIELD(isNatural);
READ_NODE_FIELD(larg);
READ_NODE_FIELD(rarg);
- READ_NODE_FIELD(using);
+ READ_NODE_FIELD(usingClause);
READ_NODE_FIELD(quals);
READ_NODE_FIELD(alias);
READ_INT_FIELD(rtindex);
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/plan/subselect.c,v 1.151 2009/07/06 02:16:03 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/plan/subselect.c,v 1.152 2009/07/16 06:33:43 petere Exp $
*
*-------------------------------------------------------------------------
*/
result->isNatural = false;
result->larg = NULL; /* caller must fill this in */
result->rarg = (Node *) rtr;
- result->using = NIL;
+ result->usingClause = NIL;
result->quals = quals;
result->alias = NULL;
result->rtindex = 0; /* we don't need an RTE for it */
result->rarg = (Node *) linitial(subselect->jointree->fromlist);
else
result->rarg = (Node *) subselect->jointree;
- result->using = NIL;
+ result->usingClause = NIL;
result->quals = whereClause;
result->alias = NULL;
result->rtindex = 0; /* we don't need an RTE for it */
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
*/
Selectivity
restriction_selectivity(PlannerInfo *root,
- Oid operator,
+ Oid operatorid,
List *args,
int varRelid)
{
- RegProcedure oprrest = get_oprrest(operator);
+ RegProcedure oprrest = get_oprrest(operatorid);
float8 result;
/*
result = DatumGetFloat8(OidFunctionCall4(oprrest,
PointerGetDatum(root),
- ObjectIdGetDatum(operator),
+ ObjectIdGetDatum(operatorid),
PointerGetDatum(args),
Int32GetDatum(varRelid)));
*/
Selectivity
join_selectivity(PlannerInfo *root,
- Oid operator,
+ Oid operatorid,
List *args,
JoinType jointype,
SpecialJoinInfo *sjinfo)
{
- RegProcedure oprjoin = get_oprjoin(operator);
+ RegProcedure oprjoin = get_oprjoin(operatorid);
float8 result;
/*
result = DatumGetFloat8(OidFunctionCall5(oprjoin,
PointerGetDatum(root),
- ObjectIdGetDatum(operator),
+ ObjectIdGetDatum(operatorid),
PointerGetDatum(args),
Int16GetDatum(jointype),
PointerGetDatum(sjinfo)));
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.669 2009/07/14 20:24:10 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.670 2009/07/16 06:33:43 petere Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
{
ColumnDef *n = makeNode(ColumnDef);
n->colname = $1;
- n->typename = $2;
+ n->typeName = $2;
n->constraints = $3;
n->is_local = true;
$$ = (Node *)n;
{
ColumnDef *n = makeNode(ColumnDef);
n->colname = $1;
- n->typename = NULL;
+ n->typeName = NULL;
n->inhcount = 0;
n->is_local = true;
n->is_not_null = false;
| CREATE TYPE_P any_name AS ENUM_P '(' enum_val_list ')'
{
CreateEnumStmt *n = makeNode(CreateEnumStmt);
- n->typename = $3;
+ n->typeName = $3;
n->vals = $7;
$$ = (Node *)n;
}
{
CreateDomainStmt *n = makeNode(CreateDomainStmt);
n->domainname = $3;
- n->typename = $5;
+ n->typeName = $5;
n->constraints = $6;
$$ = (Node *)n;
}
{
AlterDomainStmt *n = makeNode(AlterDomainStmt);
n->subtype = 'T';
- n->typename = $3;
+ n->typeName = $3;
n->def = $4;
$$ = (Node *)n;
}
{
AlterDomainStmt *n = makeNode(AlterDomainStmt);
n->subtype = 'N';
- n->typename = $3;
+ n->typeName = $3;
$$ = (Node *)n;
}
/* ALTER DOMAIN <domain> SET NOT NULL */
{
AlterDomainStmt *n = makeNode(AlterDomainStmt);
n->subtype = 'O';
- n->typename = $3;
+ n->typeName = $3;
$$ = (Node *)n;
}
/* ALTER DOMAIN <domain> ADD CONSTRAINT ... */
{
AlterDomainStmt *n = makeNode(AlterDomainStmt);
n->subtype = 'C';
- n->typename = $3;
+ n->typeName = $3;
n->def = $5;
$$ = (Node *)n;
}
{
AlterDomainStmt *n = makeNode(AlterDomainStmt);
n->subtype = 'X';
- n->typename = $3;
+ n->typeName = $3;
n->name = $6;
n->behavior = $7;
$$ = (Node *)n;
n->isNatural = FALSE;
n->larg = $1;
n->rarg = $4;
- n->using = NIL;
+ n->usingClause = NIL;
n->quals = NULL;
$$ = n;
}
n->larg = $1;
n->rarg = $4;
if ($5 != NULL && IsA($5, List))
- n->using = (List *) $5; /* USING clause */
+ n->usingClause = (List *) $5; /* USING clause */
else
n->quals = $5; /* ON clause */
$$ = n;
n->larg = $1;
n->rarg = $3;
if ($4 != NULL && IsA($4, List))
- n->using = (List *) $4; /* USING clause */
+ n->usingClause = (List *) $4; /* USING clause */
else
n->quals = $4; /* ON clause */
$$ = n;
n->isNatural = TRUE;
n->larg = $1;
n->rarg = $5;
- n->using = NIL; /* figure out which columns later... */
+ n->usingClause = NIL; /* figure out which columns later... */
n->quals = NULL; /* fill later */
$$ = n;
}
n->isNatural = TRUE;
n->larg = $1;
n->rarg = $4;
- n->using = NIL; /* figure out which columns later... */
+ n->usingClause = NIL; /* figure out which columns later... */
n->quals = NULL; /* fill later */
$$ = n;
}
{
ColumnDef *n = makeNode(ColumnDef);
n->colname = $1;
- n->typename = $2;
+ n->typeName = $2;
n->constraints = NIL;
n->is_local = true;
$$ = (Node *)n;
XmlSerialize *n = makeNode(XmlSerialize);
n->xmloption = $3;
n->expr = $4;
- n->typename = $6;
+ n->typeName = $6;
n->location = @1;
$$ = (Node *)n;
}
{
TypeCast *n = makeNode(TypeCast);
n->arg = arg;
- n->typename = typename;
+ n->typeName = typename;
n->location = location;
return (Node *) n;
}
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
ListCell *lx,
*rx;
- Assert(j->using == NIL); /* shouldn't have USING() too */
+ Assert(j->usingClause == NIL); /* shouldn't have USING() too */
foreach(lx, l_colnames)
{
rlist = lappend(rlist, m_name);
}
- j->using = rlist;
+ j->usingClause = rlist;
}
/*
res_colnames = NIL;
res_colvars = NIL;
- if (j->using)
+ if (j->usingClause)
{
/*
* JOIN/USING (or NATURAL JOIN, as transformed above). Transform
* the list into an explicit ON-condition, and generate a list of
* merged result columns.
*/
- List *ucols = j->using;
+ List *ucols = j->usingClause;
List *l_usingvars = NIL;
List *r_usingvars = NIL;
ListCell *ucol;
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
Oid elementType;
int32 targetTypmod;
- targetType = typenameTypeId(pstate, tc->typename,
+ targetType = typenameTypeId(pstate, tc->typeName,
&targetTypmod);
elementType = get_element_type(targetType);
if (OidIsValid(elementType))
XMLOID,
"XMLSERIALIZE"));
- targetType = typenameTypeId(pstate, xs->typename, &targetTypmod);
+ targetType = typenameTypeId(pstate, xs->typeName, &targetTypmod);
xexpr->xmloption = xs->xmloption;
xexpr->location = xs->location;
int32 targetTypmod;
int location;
- targetType = typenameTypeId(pstate, tc->typename, &targetTypmod);
+ targetType = typenameTypeId(pstate, tc->typeName, &targetTypmod);
if (inputType == InvalidOid)
return expr; /* do nothing if NULL input */
*/
location = tc->location;
if (location < 0)
- location = tc->typename->location;
+ location = tc->typeName->location;
result = coerce_to_target_type(pstate, expr, inputType,
targetType, targetTypmod,
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
int32 attrtypmod;
attrname = pstrdup(n->colname);
- if (n->typename->setof)
+ if (n->typeName->setof)
ereport(ERROR,
(errcode(ERRCODE_INVALID_TABLE_DEFINITION),
errmsg("column \"%s\" cannot be declared SETOF",
attrname),
- parser_errposition(pstate, n->typename->location)));
- attrtype = typenameTypeId(pstate, n->typename, &attrtypmod);
+ parser_errposition(pstate, n->typeName->location)));
+ attrtype = typenameTypeId(pstate, n->typeName, &attrtypmod);
eref->colnames = lappend(eref->colnames, makeString(attrname));
rte->funccoltypes = lappend_oid(rte->funccoltypes, attrtype);
rte->funccoltypmods = lappend_int(rte->funccoltypmods, attrtypmod);
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
name);
if (strength <= 1)
{
- if (((TypeCast *) node)->typename != NULL)
+ if (((TypeCast *) node)->typeName != NULL)
{
- *name = strVal(llast(((TypeCast *) node)->typename->names));
+ *name = strVal(llast(((TypeCast *) node)->typeName->names));
return 1;
}
}
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
#include "utils/syscache.h"
-static int32 typenameTypeMod(ParseState *pstate, const TypeName *typename,
+static int32 typenameTypeMod(ParseState *pstate, const TypeName *typeName,
Type typ);
* pstate is only used for error location info, and may be NULL.
*/
Type
-LookupTypeName(ParseState *pstate, const TypeName *typename,
+LookupTypeName(ParseState *pstate, const TypeName *typeName,
int32 *typmod_p)
{
Oid typoid;
HeapTuple tup;
int32 typmod;
- if (typename->names == NIL)
+ if (typeName->names == NIL)
{
/* We have the OID already if it's an internally generated TypeName */
- typoid = typename->typeid;
+ typoid = typeName->typeOid;
}
- else if (typename->pct_type)
+ else if (typeName->pct_type)
{
/* Handle %TYPE reference to type of an existing field */
- RangeVar *rel = makeRangeVar(NULL, NULL, typename->location);
+ RangeVar *rel = makeRangeVar(NULL, NULL, typeName->location);
char *field = NULL;
Oid relid;
AttrNumber attnum;
/* deconstruct the name list */
- switch (list_length(typename->names))
+ switch (list_length(typeName->names))
{
case 1:
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("improper %%TYPE reference (too few dotted names): %s",
- NameListToString(typename->names)),
- parser_errposition(pstate, typename->location)));
+ NameListToString(typeName->names)),
+ parser_errposition(pstate, typeName->location)));
break;
case 2:
- rel->relname = strVal(linitial(typename->names));
- field = strVal(lsecond(typename->names));
+ rel->relname = strVal(linitial(typeName->names));
+ field = strVal(lsecond(typeName->names));
break;
case 3:
- rel->schemaname = strVal(linitial(typename->names));
- rel->relname = strVal(lsecond(typename->names));
- field = strVal(lthird(typename->names));
+ rel->schemaname = strVal(linitial(typeName->names));
+ rel->relname = strVal(lsecond(typeName->names));
+ field = strVal(lthird(typeName->names));
break;
case 4:
- rel->catalogname = strVal(linitial(typename->names));
- rel->schemaname = strVal(lsecond(typename->names));
- rel->relname = strVal(lthird(typename->names));
- field = strVal(lfourth(typename->names));
+ rel->catalogname = strVal(linitial(typeName->names));
+ rel->schemaname = strVal(lsecond(typeName->names));
+ rel->relname = strVal(lthird(typeName->names));
+ field = strVal(lfourth(typeName->names));
break;
default:
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("improper %%TYPE reference (too many dotted names): %s",
- NameListToString(typename->names)),
- parser_errposition(pstate, typename->location)));
+ NameListToString(typeName->names)),
+ parser_errposition(pstate, typeName->location)));
break;
}
(errcode(ERRCODE_UNDEFINED_COLUMN),
errmsg("column \"%s\" of relation \"%s\" does not exist",
field, rel->relname),
- parser_errposition(pstate, typename->location)));
+ parser_errposition(pstate, typeName->location)));
typoid = get_atttype(relid, attnum);
/* this construct should never have an array indicator */
- Assert(typename->arrayBounds == NIL);
+ Assert(typeName->arrayBounds == NIL);
/* emit nuisance notice (intentionally not errposition'd) */
ereport(NOTICE,
(errmsg("type reference %s converted to %s",
- TypeNameToString(typename),
+ TypeNameToString(typeName),
format_type_be(typoid))));
}
else
char *typname;
/* deconstruct the name list */
- DeconstructQualifiedName(typename->names, &schemaname, &typname);
+ DeconstructQualifiedName(typeName->names, &schemaname, &typname);
if (schemaname)
{
}
/* If an array reference, return the array type instead */
- if (typename->arrayBounds != NIL)
+ if (typeName->arrayBounds != NIL)
typoid = get_array_type(typoid);
}
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for type %u", typoid);
- typmod = typenameTypeMod(pstate, typename, (Type) tup);
+ typmod = typenameTypeMod(pstate, typeName, (Type) tup);
if (typmod_p)
*typmod_p = typmod;
* Callers of this can therefore assume the result is a fully valid type.
*/
Type
-typenameType(ParseState *pstate, const TypeName *typename, int32 *typmod_p)
+typenameType(ParseState *pstate, const TypeName *typeName, int32 *typmod_p)
{
Type tup;
- tup = LookupTypeName(pstate, typename, typmod_p);
+ tup = LookupTypeName(pstate, typeName, typmod_p);
if (tup == NULL)
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("type \"%s\" does not exist",
- TypeNameToString(typename)),
- parser_errposition(pstate, typename->location)));
+ TypeNameToString(typeName)),
+ parser_errposition(pstate, typeName->location)));
if (!((Form_pg_type) GETSTRUCT(tup))->typisdefined)
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("type \"%s\" is only a shell",
- TypeNameToString(typename)),
- parser_errposition(pstate, typename->location)));
+ TypeNameToString(typeName)),
+ parser_errposition(pstate, typeName->location)));
return tup;
}
* not the syscache entry.
*/
Oid
-typenameTypeId(ParseState *pstate, const TypeName *typename, int32 *typmod_p)
+typenameTypeId(ParseState *pstate, const TypeName *typeName, int32 *typmod_p)
{
Oid typoid;
Type tup;
- tup = typenameType(pstate, typename, typmod_p);
+ tup = typenameType(pstate, typeName, typmod_p);
typoid = HeapTupleGetOid(tup);
ReleaseSysCache(tup);
* pstate is only used for error location info, and may be NULL.
*/
static int32
-typenameTypeMod(ParseState *pstate, const TypeName *typename, Type typ)
+typenameTypeMod(ParseState *pstate, const TypeName *typeName, Type typ)
{
int32 result;
Oid typmodin;
ParseCallbackState pcbstate;
/* Return prespecified typmod if no typmod expressions */
- if (typename->typmods == NIL)
- return typename->typemod;
+ if (typeName->typmods == NIL)
+ return typeName->typemod;
/*
* Else, type had better accept typmods. We give a special error message
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("type modifier cannot be specified for shell type \"%s\"",
- TypeNameToString(typename)),
- parser_errposition(pstate, typename->location)));
+ TypeNameToString(typeName)),
+ parser_errposition(pstate, typeName->location)));
typmodin = ((Form_pg_type) GETSTRUCT(typ))->typmodin;
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("type modifier is not allowed for type \"%s\"",
- TypeNameToString(typename)),
- parser_errposition(pstate, typename->location)));
+ TypeNameToString(typeName)),
+ parser_errposition(pstate, typeName->location)));
/*
* Convert the list of raw-grammar-output expressions to a cstring array.
* Currently, we allow simple numeric constants, string literals, and
* identifiers; possibly this list could be extended.
*/
- datums = (Datum *) palloc(list_length(typename->typmods) * sizeof(Datum));
+ datums = (Datum *) palloc(list_length(typeName->typmods) * sizeof(Datum));
n = 0;
- foreach(l, typename->typmods)
+ foreach(l, typeName->typmods)
{
Node *tm = (Node *) lfirst(l);
char *cstr = NULL;
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("type modifiers must be simple constants or identifiers"),
- parser_errposition(pstate, typename->location)));
+ parser_errposition(pstate, typeName->location)));
datums[n++] = CStringGetDatum(cstr);
}
-2, false, 'c');
/* arrange to report location if type's typmodin function fails */
- setup_parser_errposition_callback(&pcbstate, pstate, typename->location);
+ setup_parser_errposition_callback(&pcbstate, pstate, typeName->location);
result = DatumGetInt32(OidFunctionCall1(typmodin,
PointerGetDatum(arrtypmod)));
* it is mostly used for reporting lookup errors.
*/
static void
-appendTypeNameToBuffer(const TypeName *typename, StringInfo string)
+appendTypeNameToBuffer(const TypeName *typeName, StringInfo string)
{
- if (typename->names != NIL)
+ if (typeName->names != NIL)
{
/* Emit possibly-qualified name as-is */
ListCell *l;
- foreach(l, typename->names)
+ foreach(l, typeName->names)
{
- if (l != list_head(typename->names))
+ if (l != list_head(typeName->names))
appendStringInfoChar(string, '.');
appendStringInfoString(string, strVal(lfirst(l)));
}
else
{
/* Look up internally-specified type */
- appendStringInfoString(string, format_type_be(typename->typeid));
+ appendStringInfoString(string, format_type_be(typeName->typeOid));
}
/*
* Add decoration as needed, but only for fields considered by
* LookupTypeName
*/
- if (typename->pct_type)
+ if (typeName->pct_type)
appendStringInfoString(string, "%TYPE");
- if (typename->arrayBounds != NIL)
+ if (typeName->arrayBounds != NIL)
appendStringInfoString(string, "[]");
}
* it is mostly used for reporting lookup errors.
*/
char *
-TypeNameToString(const TypeName *typename)
+TypeNameToString(const TypeName *typeName)
{
StringInfoData string;
initStringInfo(&string);
- appendTypeNameToBuffer(typename, &string);
+ appendTypeNameToBuffer(typeName, &string);
return string.data;
}
initStringInfo(&string);
foreach(l, typenames)
{
- TypeName *typename = (TypeName *) lfirst(l);
+ TypeName *typeName = (TypeName *) lfirst(l);
- Assert(IsA(typename, TypeName));
+ Assert(IsA(typeName, TypeName));
if (l != list_head(typenames))
appendStringInfoChar(&string, ',');
- appendTypeNameToBuffer(typename, &string);
+ appendTypeNameToBuffer(typeName, &string);
}
return string.data;
}
SelectStmt *stmt;
ResTarget *restarget;
TypeCast *typecast;
- TypeName *typename;
+ TypeName *typeName;
ErrorContextCallback ptserrcontext;
/* make sure we give useful error for empty input */
typecast->arg == NULL ||
!IsA(typecast->arg, A_Const))
goto fail;
- typename = typecast->typename;
- if (typename == NULL ||
- !IsA(typename, TypeName))
+ typeName = typecast->typeName;
+ if (typeName == NULL ||
+ !IsA(typeName, TypeName))
goto fail;
- if (typename->setof)
+ if (typeName->setof)
goto fail;
- *type_id = typenameTypeId(NULL, typename, typmod_p);
+ *type_id = typenameTypeId(NULL, typeName, typmod_p);
pfree(buf.data);
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/parser/parse_utilcmd.c,v 2.22 2009/07/12 17:12:34 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/parse_utilcmd.c,v 2.23 2009/07/16 06:33:43 petere Exp $
*
*-------------------------------------------------------------------------
*/
/* Check for SERIAL pseudo-types */
is_serial = false;
- if (list_length(column->typename->names) == 1 &&
- !column->typename->pct_type)
+ if (list_length(column->typeName->names) == 1 &&
+ !column->typeName->pct_type)
{
- char *typname = strVal(linitial(column->typename->names));
+ char *typname = strVal(linitial(column->typeName->names));
if (strcmp(typname, "serial") == 0 ||
strcmp(typname, "serial4") == 0)
{
is_serial = true;
- column->typename->names = NIL;
- column->typename->typeid = INT4OID;
+ column->typeName->names = NIL;
+ column->typeName->typeOid = INT4OID;
}
else if (strcmp(typname, "bigserial") == 0 ||
strcmp(typname, "serial8") == 0)
{
is_serial = true;
- column->typename->names = NIL;
- column->typename->typeid = INT8OID;
+ column->typeName->names = NIL;
+ column->typeName->typeOid = INT8OID;
}
/*
* typeid, LookupTypeName won't notice arrayBounds. We don't need any
* special coding for serial(typmod) though.
*/
- if (is_serial && column->typename->arrayBounds != NIL)
+ if (is_serial && column->typeName->arrayBounds != NIL)
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("array of serial is not implemented")));
snamenode->val.val.str = qstring;
snamenode->location = -1;
castnode = makeNode(TypeCast);
- castnode->typename = SystemTypeName("regclass");
+ castnode->typeName = SystemTypeName("regclass");
castnode->arg = (Node *) snamenode;
castnode->location = -1;
funccallnode = makeNode(FuncCall);
*/
def = makeNode(ColumnDef);
def->colname = pstrdup(attributeName);
- def->typename = makeTypeNameFromOid(attribute->atttypid,
+ def->typeName = makeTypeNameFromOid(attribute->atttypid,
attribute->atttypmod);
def->inhcount = 0;
def->is_local = true;
/*
* 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);
}
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
* Recursively alter column default for table and, if
* requested, for descendants
*/
- AlterDomainDefault(stmt->typename,
+ AlterDomainDefault(stmt->typeName,
stmt->def);
break;
case 'N': /* ALTER DOMAIN DROP NOT NULL */
- AlterDomainNotNull(stmt->typename,
+ AlterDomainNotNull(stmt->typeName,
false);
break;
case 'O': /* ALTER DOMAIN SET NOT NULL */
- AlterDomainNotNull(stmt->typename,
+ AlterDomainNotNull(stmt->typeName,
true);
break;
case 'C': /* ADD CONSTRAINT */
- AlterDomainAddConstraint(stmt->typename,
+ AlterDomainAddConstraint(stmt->typeName,
stmt->def);
break;
case 'X': /* DROP CONSTRAINT */
- AlterDomainDropConstraint(stmt->typename,
+ AlterDomainDropConstraint(stmt->typeName,
stmt->name,
stmt->behavior);
break;
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
if (dstate->isend)
PG_RETURN_POINTER(NULL);
- stored = (LexemeInfo *) dstate->private;
+ stored = (LexemeInfo *) dstate->private_state;
if (stored)
curpos = stored->posinsubst + 1;
info = NULL; /* word isn't recognized */
}
- dstate->private = (void *) info;
+ dstate->private_state = (void *) info;
if (!info)
{
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
dict = lookup_ts_dictionary_cache(map->dictIds[i]);
ld->dictState.isend = ld->dictState.getnext = false;
- ld->dictState.private = NULL;
+ ld->dictState.private_state = NULL;
res = (TSLexeme *) DatumGetPointer(FunctionCall4(
&(dict->lexize),
PointerGetDatum(dict->dictData),
for (i = 0; i < query->size; i++)
{
if (item->type == QI_VAL &&
- tsCompareString(GETOPERAND(query) + item->operand.distance, item->operand.length,
- buf, buflen, item->operand.prefix) == 0)
+ tsCompareString(GETOPERAND(query) + item->qoperand.distance, item->qoperand.length,
+ buf, buflen, item->qoperand.prefix) == 0)
{
if (word->item)
{
memcpy(&(prs->words[prs->curwords]), word, sizeof(HeadlineWordEntry));
- prs->words[prs->curwords].item = &item->operand;
+ prs->words[prs->curwords].item = &item->qoperand;
prs->words[prs->curwords].repeated = 1;
prs->curwords++;
}
else
- word->item = &item->operand;
+ word->item = &item->qoperand;
}
item++;
}
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
}
/* Current TSQuery node is an operator */
- switch (item->operator.oper)
+ switch (item->qoperator.oper)
{
case OP_NOT:
selec = 1.0 - tsquery_opr_selec(item + 1, operand,
case OP_AND:
s1 = tsquery_opr_selec(item + 1, operand,
lookup, length, minfreq);
- s2 = tsquery_opr_selec(item + item->operator.left, operand,
+ s2 = tsquery_opr_selec(item + item->qoperator.left, operand,
lookup, length, minfreq);
selec = s1 * s2;
break;
case OP_OR:
s1 = tsquery_opr_selec(item + 1, operand,
lookup, length, minfreq);
- s2 = tsquery_opr_selec(item + item->operator.left, operand,
+ s2 = tsquery_opr_selec(item + item->qoperator.left, operand,
lookup, length, minfreq);
selec = s1 + s2 - s1 * s2;
break;
default:
- elog(ERROR, "unrecognized operator: %d", item->operator.oper);
+ elog(ERROR, "unrecognized operator: %d", item->qoperator.oper);
selec = 0; /* keep compiler quiet */
break;
}
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
}
for (i = pos; i < prs->curwords; i++)
{
- if (prs->words[i].item == &item->operand)
+ if (prs->words[i].item == &item->qoperand)
{
if (i > *q)
*q = i;
}
for (i = *q; i >= pos; i--)
{
- if (prs->words[i].item == &item->operand)
+ if (prs->words[i].item == &item->qoperand)
{
if (i < *p)
*p = i;
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
if (!j->isNatural)
{
- if (j->using)
+ if (j->usingClause)
{
ListCell *col;
appendStringInfo(buf, " USING (");
- foreach(col, j->using)
+ foreach(col, j->usingClause)
{
- if (col != list_head(j->using))
+ if (col != list_head(j->usingClause))
appendStringInfo(buf, ", ");
appendStringInfoString(buf,
quote_identifier(strVal(lfirst(col))));
/*
* quote_qualified_identifier - Quote a possibly-qualified identifier
*
- * Return a name of the form namespace.ident, or just ident if namespace
+ * Return a name of the form qualifier.ident, or just ident if qualifier
* is NULL, quoting each component if necessary. The result is palloc'd.
*/
char *
-quote_qualified_identifier(const char *namespace,
+quote_qualified_identifier(const char *qualifier,
const char *ident)
{
StringInfoData buf;
initStringInfo(&buf);
- if (namespace)
- appendStringInfo(&buf, "%s.", quote_identifier(namespace));
+ if (qualifier)
+ appendStringInfo(&buf, "%s.", quote_identifier(qualifier));
appendStringInfoString(&buf, quote_identifier(ident));
return buf.data;
}
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
if (item[i].type == QI_VAL)
{
text *txt;
- QueryOperand *val = &item[i].operand;
+ QueryOperand *val = &item[i].qoperand;
txt = cstring_to_text_with_len(GETOPERAND(query) + val->distance,
val->length);
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
{
Assert(ptr[*pos].type == QI_OPR);
- if (ptr[*pos].operator.oper == OP_NOT)
+ if (ptr[*pos].qoperator.oper == OP_NOT)
{
- ptr[*pos].operator.left = 1;
+ ptr[*pos].qoperator.left = 1;
(*pos)++;
findoprnd_recurse(ptr, pos, nnodes);
}
else
{
- QueryOperator *curitem = &ptr[*pos].operator;
+ QueryOperator *curitem = &ptr[*pos].qoperator;
int tmp = *pos;
Assert(curitem->oper == OP_AND || curitem->oper == OP_OR);
if (in->curpol->type == QI_VAL)
{
- QueryOperand *curpol = &in->curpol->operand;
+ QueryOperand *curpol = &in->curpol->qoperand;
char *op = in->op + curpol->distance;
int clen;
*(in->cur) = '\0';
in->curpol++;
}
- else if (in->curpol->operator.oper == OP_NOT)
+ else if (in->curpol->qoperator.oper == OP_NOT)
{
bool isopr = false;
}
else
{
- int8 op = in->curpol->operator.oper;
+ int8 op = in->curpol->qoperator.oper;
INFIX nrm;
in->curpol++;
switch (item->type)
{
case QI_VAL:
- pq_sendint(&buf, item->operand.weight, sizeof(uint8));
- pq_sendint(&buf, item->operand.prefix, sizeof(uint8));
- pq_sendstring(&buf, GETOPERAND(query) + item->operand.distance);
+ pq_sendint(&buf, item->qoperand.weight, sizeof(uint8));
+ pq_sendint(&buf, item->qoperand.prefix, sizeof(uint8));
+ pq_sendstring(&buf, GETOPERAND(query) + item->qoperand.distance);
break;
case QI_OPR:
- pq_sendint(&buf, item->operator.oper, sizeof(item->operator.oper));
+ pq_sendint(&buf, item->qoperator.oper, sizeof(item->qoperator.oper));
break;
default:
elog(ERROR, "unrecognized tsquery node type: %d", item->type);
COMP_CRC32(valcrc, val, val_len);
FIN_CRC32(valcrc);
- item->operand.weight = weight;
- item->operand.prefix = (prefix) ? true : false;
- item->operand.valcrc = (int32) valcrc;
- item->operand.length = val_len;
- item->operand.distance = datalen;
+ item->qoperand.weight = weight;
+ item->qoperand.prefix = (prefix) ? true : false;
+ item->qoperand.valcrc = (int32) valcrc;
+ item->qoperand.length = val_len;
+ item->qoperand.distance = datalen;
/*
* Operand strings are copied to the final struct after this loop;
if (i == size - 1)
elog(ERROR, "invalid pointer to right operand");
- item->operator.oper = oper;
+ item->qoperator.oper = oper;
}
else
elog(ERROR, "unrecognized tsquery node type: %d", item->type);
{
if (item->type == QI_VAL)
{
- memcpy(ptr, operands[i], item->operand.length + 1);
- ptr += item->operand.length + 1;
+ memcpy(ptr, operands[i], item->qoperand.length + 1);
+ ptr += item->qoperand.length + 1;
}
item++;
}
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
if (in->type == QI_OPR)
{
node->right = maketree(in + 1);
- if (in->operator.oper != OP_NOT)
- node->left = maketree(in + in->operator.left);
+ if (in->qoperator.oper != OP_NOT)
+ node->left = maketree(in + in->qoperator.left);
}
return node;
}
memcpy((void *) &(state->ptr[state->cur]), (void *) node->valnode, sizeof(QueryItem));
if (node->valnode->type == QI_VAL)
state->cur++;
- else if (node->valnode->operator.oper == OP_NOT)
+ else if (node->valnode->qoperator.oper == OP_NOT)
{
- state->ptr[state->cur].operator.left = 1;
+ state->ptr[state->cur].qoperator.left = 1;
state->cur++;
plainnode(state, node->right);
}
state->cur++;
plainnode(state, node->right);
- state->ptr[cur].operator.left = state->cur - cur;
+ state->ptr[cur].qoperator.left = state->cur - cur;
plainnode(state, node->left);
}
pfree(node);
if (node->valnode->type == QI_VAL)
return node;
- if (node->valnode->operator.oper == OP_NOT)
+ if (node->valnode->qoperator.oper == OP_NOT)
{
freetree(node);
return NULL;
}
/* operator & or | */
- if (node->valnode->operator.oper == OP_OR)
+ if (node->valnode->qoperator.oper == OP_OR)
{
if ((node->left = clean_NOT_intree(node->left)) == NULL ||
(node->right = clean_NOT_intree(node->right)) == NULL)
{
NODE *res = node;
- Assert(node->valnode->operator.oper == OP_AND);
+ Assert(node->valnode->qoperator.oper == OP_AND);
node->left = clean_NOT_intree(node->left);
node->right = clean_NOT_intree(node->right);
Assert(node->valnode->type == QI_OPR);
- if (node->valnode->operator.oper == OP_NOT)
+ if (node->valnode->qoperator.oper == OP_NOT)
{
node->right = clean_fakeval_intree(node->right, &rresult);
if (!node->right)
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
res->valnode = (QueryItem *) palloc0(sizeof(QueryItem));
res->valnode->type = QI_OPR;
- res->valnode->operator.oper = operator;
+ res->valnode->qoperator.oper = operator;
res->child = (QTNode **) palloc0(sizeof(QTNode *) * 2);
res->child[0] = QT2QTN(GETQUERY(b), GETOPERAND(b));
res->valnode = (QueryItem *) palloc0(sizeof(QueryItem));
res->valnode->type = QI_OPR;
- res->valnode->operator.oper = OP_NOT;
+ res->valnode->qoperator.oper = OP_NOT;
res->child = (QTNode **) palloc0(sizeof(QTNode *));
res->child[0] = QT2QTN(GETQUERY(a), GETOPERAND(a));
for (i = 0; i < a->size; i++)
{
if (ptr->type == QI_VAL)
- sign |= ((TSQuerySign) 1) << (ptr->operand.valcrc % TSQS_SIGLEN);
+ sign |= ((TSQuerySign) 1) << (ptr->qoperand.valcrc % TSQS_SIGLEN);
ptr++;
}
if (ie[i].type != QI_VAL)
continue;
for (j = 0; j < query->size; j++)
- if (iq[j].type == QI_VAL && ie[i].operand.valcrc == iq[j].operand.valcrc)
+ if (iq[j].type == QI_VAL && ie[i].qoperand.valcrc == iq[j].qoperand.valcrc)
{
j = query->size + 1;
break;
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
if (node->valnode->type == QI_OPR)
{
- if (node->valnode->operator.oper != ex->valnode->operator.oper)
+ if (node->valnode->qoperator.oper != ex->valnode->qoperator.oper)
return node;
if (node->nchild == ex->nchild)
{
Assert(node->valnode->type == QI_VAL);
- if (node->valnode->operand.valcrc != ex->valnode->operand.valcrc)
+ if (node->valnode->qoperand.valcrc != ex->valnode->qoperand.valcrc)
return node;
else if (QTNEq(node, ex))
{
root->nchild = j;
- if (root->valnode->operator.oper == OP_NOT && root->nchild == 0)
+ if (root->valnode->qoperator.oper == OP_NOT && root->nchild == 0)
{
QTNFree(root);
root = NULL;
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
node->child = (QTNode **) palloc0(sizeof(QTNode *) * 2);
node->child[0] = QT2QTN(in + 1, operand);
node->sign = node->child[0]->sign;
- if (in->operator.oper == OP_NOT)
+ if (in->qoperator.oper == OP_NOT)
node->nchild = 1;
else
{
node->nchild = 2;
- node->child[1] = QT2QTN(in + in->operator.left, operand);
+ node->child[1] = QT2QTN(in + in->qoperator.left, operand);
node->sign |= node->child[1]->sign;
}
}
else if (operand)
{
- node->word = operand + in->operand.distance;
- node->sign = 1 << (in->operand.valcrc % 32);
+ node->word = operand + in->qoperand.distance;
+ node->sign = 1 << (in->qoperand.valcrc % 32);
}
return node;
if (an->valnode->type == QI_OPR)
{
- QueryOperator *ao = &an->valnode->operator;
- QueryOperator *bo = &bn->valnode->operator;
+ QueryOperator *ao = &an->valnode->qoperator;
+ QueryOperator *bo = &bn->valnode->qoperator;
if (ao->oper != bo->oper)
return (ao->oper > bo->oper) ? -1 : 1;
}
else
{
- QueryOperand *ao = &an->valnode->operand;
- QueryOperand *bo = &bn->valnode->operand;
+ QueryOperand *ao = &an->valnode->qoperand;
+ QueryOperand *bo = &bn->valnode->qoperand;
Assert(an->valnode->type == QI_VAL);
{
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;
nn->sign = nn->child[0]->sign | nn->child[1]->sign;
nn->valnode->type = in->valnode->type;
- nn->valnode->operator.oper = in->valnode->operator.oper;
+ nn->valnode->qoperator.oper = in->valnode->qoperator.oper;
in->child[0] = nn;
in->child[1] = in->child[in->nchild - 1];
}
else
{
- *sumlen += in->valnode->operand.length + 1;
+ *sumlen += in->valnode->qoperand.length + 1;
}
}
{
memcpy(state->curitem, in->valnode, sizeof(QueryOperand));
- memcpy(state->curoperand, in->word, in->valnode->operand.length);
- state->curitem->operand.distance = state->curoperand - state->operand;
- state->curoperand[in->valnode->operand.length] = '\0';
- state->curoperand += in->valnode->operand.length + 1;
+ memcpy(state->curoperand, in->word, in->valnode->qoperand.length);
+ state->curitem->qoperand.distance = state->curoperand - state->operand;
+ state->curoperand[in->valnode->qoperand.length] = '\0';
+ state->curoperand += in->valnode->qoperand.length + 1;
state->curitem++;
}
else
if (in->nchild == 2)
{
- curitem->operator.left = state->curitem - curitem;
+ curitem->qoperator.left = state->curitem - curitem;
fillQT(state, in->child[1]);
}
}
if (in->valnode->type == QI_VAL)
{
- out->word = palloc(in->valnode->operand.length + 1);
- memcpy(out->word, in->word, in->valnode->operand.length);
- out->word[in->valnode->operand.length] = '\0';
+ out->word = palloc(in->valnode->qoperand.length + 1);
+ memcpy(out->word, in->word, in->valnode->qoperand.length);
+ out->word[in->valnode->qoperand.length] = '\0';
out->flags |= QTN_WORDFREE;
}
else
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
return 0.0;
/* XXX: What about NOT? */
- res = (item->type == QI_OPR && item->operator.oper == OP_AND) ?
+ res = (item->type == QI_OPR && item->qoperator.oper == OP_AND) ?
calc_rank_and(w, t, q) : calc_rank_or(w, t, q);
if (res < 0)
if (item[i].type != QI_VAL)
continue;
- curoperand = &item[i].operand;
+ curoperand = &item[i].qoperand;
if (QR_GET_OPERAND_EXISTS(qr, &item[i]))
continue;
for (k = 0; k < qr->query->size; k++)
{
- QueryOperand *kptr = &item[k].operand;
- QueryOperand *iptr = &item[i].operand;
+ QueryOperand *kptr = &item[k].qoperand;
+ QueryOperand *iptr = &item[i].qoperand;
if (k == i ||
(item[k].type == QI_VAL &&
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
if (curitem->type == QI_VAL)
return chkcond(checkval, (QueryOperand *) curitem);
- switch (curitem->operator.oper)
+ switch (curitem->qoperator.oper)
{
case OP_NOT:
if (calcnot)
else
return true;
case OP_AND:
- if (TS_execute(curitem + curitem->operator.left, checkval, calcnot, chkcond))
+ if (TS_execute(curitem + curitem->qoperator.left, checkval, calcnot, chkcond))
return TS_execute(curitem + 1, checkval, calcnot, chkcond);
else
return false;
case OP_OR:
- if (TS_execute(curitem + curitem->operator.left, checkval, calcnot, chkcond))
+ if (TS_execute(curitem + curitem->qoperator.left, checkval, calcnot, chkcond))
return true;
else
return TS_execute(curitem + 1, checkval, calcnot, chkcond);
default:
- elog(ERROR, "unrecognized operator: %d", curitem->operator.oper);
+ elog(ERROR, "unrecognized operator: %d", curitem->qoperator.oper);
}
/* not reachable, but keep compiler quiet */
* Written by Peter Eisentraut <peter_e@gmx.net>.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.506 2009/07/12 17:12:34 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.507 2009/07/16 06:33:44 petere Exp $
*
*--------------------------------------------------------------------
*/
{
Node *arg = (Node *) lfirst(l);
char *val;
- TypeName *typename = NULL;
+ TypeName *typeName = NULL;
A_Const *con;
if (l != list_head(args))
TypeCast *tc = (TypeCast *) arg;
arg = tc->arg;
- typename = tc->typename;
+ typeName = tc->typeName;
}
if (!IsA(arg, A_Const))
break;
case T_String:
val = strVal(&con->val);
- if (typename != NULL)
+ if (typeName != NULL)
{
/*
* Must be a ConstInterval argument for TIME ZONE. Coerce
Datum interval;
char *intervalout;
- typoid = typenameTypeId(NULL, typename, &typmod);
+ typoid = typenameTypeId(NULL, typeName, &typmod);
Assert(typoid == INTERVALOID);
interval =
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
}
}
}
- (*context->methods->delete) (context);
+ (*context->methods->delete_context) (context);
pfree(context);
}
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/pg_constraint.h,v 1.30 2009/01/01 17:23:56 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_constraint.h,v 1.31 2009/07/16 06:33:45 petere Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
extern bool ConstraintNameIsUsed(ConstraintCategory conCat, Oid objId,
Oid objNamespace, const char *conname);
extern char *ChooseConstraintName(const char *name1, const char *name2,
- const char *label, Oid namespace,
+ const char *label, Oid namespaceid,
List *others);
extern void AlterConstraintNamespaces(Oid ownerId, Oid oldNspId,
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/commands/defrem.h,v 1.94 2009/04/04 21:12:31 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/commands/defrem.h,v 1.95 2009/07/16 06:33:45 petere Exp $
*
*-------------------------------------------------------------------------
*/
extern char *makeObjectName(const char *name1, const char *name2,
const char *label);
extern char *ChooseRelationName(const char *name1, const char *name2,
- const char *label, Oid namespace);
+ const char *label, Oid namespaceid);
extern Oid GetDefaultOpClass(Oid type_id, Oid am_id);
/* commands/functioncmds.c */
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/commands/tablecmds.h,v 1.43 2009/06/11 14:49:11 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/commands/tablecmds.h,v 1.44 2009/07/16 06:33:45 petere Exp $
*
*-------------------------------------------------------------------------
*/
const char *origTblName,
const char *origTypeName);
-extern AttrNumber *varattnos_map(TupleDesc old, TupleDesc new);
+extern AttrNumber *varattnos_map(TupleDesc olddesc, TupleDesc newdesc);
extern AttrNumber *varattnos_map_schema(TupleDesc old, List *schema);
extern void change_varattnos_of_a_node(Node *node, const AttrNumber *newattno);
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/nodes/makefuncs.h,v 1.68 2009/06/11 14:49:11 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/nodes/makefuncs.h,v 1.69 2009/07/16 06:33:45 petere Exp $
*
*-------------------------------------------------------------------------
*/
extern TypeName *makeTypeName(char *typnam);
extern TypeName *makeTypeNameFromNameList(List *names);
-extern TypeName *makeTypeNameFromOid(Oid typeid, int32 typmod);
+extern TypeName *makeTypeNameFromOid(Oid typeOid, int32 typmod);
extern FuncExpr *makeFuncExpr(Oid funcid, Oid rettype,
List *args, CoercionForm fformat);
extern DefElem *makeDefElem(char *name, Node *arg);
-extern DefElem *makeDefElemExtended(char *namespace, char *name, Node *arg,
+extern DefElem *makeDefElemExtended(char *nameSpace, char *name, Node *arg,
DefElemAction defaction);
#endif /* MAKEFUNC_H */
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/nodes/memnodes.h,v 1.35 2009/01/01 17:24:00 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/nodes/memnodes.h,v 1.36 2009/07/16 06:33:45 petere Exp $
*
*-------------------------------------------------------------------------
*/
void *(*realloc) (MemoryContext context, void *pointer, Size size);
void (*init) (MemoryContext context);
void (*reset) (MemoryContext context);
- void (*delete) (MemoryContext context);
+ void (*delete_context) (MemoryContext context);
Size (*get_chunk_space) (MemoryContext context, void *pointer);
bool (*is_empty) (MemoryContext context);
void (*stats) (MemoryContext context, int level);
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.395 2009/06/18 01:27:02 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.396 2009/07/16 06:33:45 petere Exp $
*
*-------------------------------------------------------------------------
*/
*
* For TypeName structures generated internally, it is often easier to
* specify the type by OID than by name. If "names" is NIL then the
- * actual type OID is given by typeid, otherwise typeid is unused.
+ * actual type OID is given by typeOid, otherwise typeOid is unused.
* Similarly, if "typmods" is NIL then the actual typmod is expected to
* be prespecified in typemod, otherwise typemod is unused.
*
{
NodeTag type;
List *names; /* qualified name (list of Value strings) */
- Oid typeid; /* type identified by OID */
+ Oid typeOid; /* type identified by OID */
bool setof; /* is a set? */
bool pct_type; /* %TYPE specified? */
List *typmods; /* type modifier expression(s) */
{
NodeTag type;
Node *arg; /* the expression being casted */
- TypeName *typename; /* the target type */
+ TypeName *typeName; /* the target type */
int location; /* token location, or -1 if unknown */
} TypeCast;
{
NodeTag type;
char *colname; /* name of column */
- TypeName *typename; /* type of column */
+ TypeName *typeName; /* type of column */
int inhcount; /* number of times column is inherited */
bool is_local; /* column has local (non-inherited) def'n */
bool is_not_null; /* NOT NULL constraint specified? */
NodeTag type;
XmlOptionType xmloption; /* DOCUMENT or CONTENT */
Node *expr;
- TypeName *typename;
+ TypeName *typeName;
int location; /* token location, or -1 if unknown */
} XmlSerialize;
* X = drop constraint
*------------
*/
- List *typename; /* domain to work on */
+ List *typeName; /* domain to work on */
char *name; /* column or constraint name to act on */
Node *def; /* definition of default or constraint */
DropBehavior behavior; /* RESTRICT or CASCADE for DROP cases */
{
NodeTag type;
List *domainname; /* qualified name (list of Value strings) */
- TypeName *typename; /* the base type */
+ TypeName *typeName; /* the base type */
List *constraints; /* constraints (list of Constraint nodes) */
} CreateDomainStmt;
typedef struct CreateEnumStmt
{
NodeTag type;
- List *typename; /* qualified name (list of Value strings) */
+ List *typeName; /* qualified name (list of Value strings) */
List *vals; /* enum values (list of Value strings) */
} CreateEnumStmt;
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/nodes/primnodes.h,v 1.149 2009/06/11 14:49:11 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/nodes/primnodes.h,v 1.150 2009/07/16 06:33:45 petere Exp $
*
*-------------------------------------------------------------------------
*/
/*----------
* JoinExpr - for SQL JOIN expressions
*
- * isNatural, using, and quals are interdependent. The user can write only
- * one of NATURAL, USING(), or ON() (this is enforced by the grammar).
+ * isNatural, usingClause, and quals are interdependent. The user can write
+ * only one of NATURAL, USING(), or ON() (this is enforced by the grammar).
* If he writes NATURAL then parse analysis generates the equivalent USING()
* list, and from that fills in "quals" with the right equality comparisons.
* If he writes USING() then "quals" is filled with equality comparisons.
bool isNatural; /* Natural join? Will need to shape table */
Node *larg; /* left subtree */
Node *rarg; /* right subtree */
- List *using; /* USING clause, if any (list of String) */
+ List *usingClause; /* USING clause, if any (list of String) */
Node *quals; /* qualifiers on join, if any */
Alias *alias; /* user-written alias clause, if any */
int rtindex; /* RT index assigned for join, or 0 */
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/optimizer/plancat.h,v 1.54 2009/06/11 14:49:11 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/optimizer/plancat.h,v 1.55 2009/07/16 06:33:45 petere Exp $
*
*-------------------------------------------------------------------------
*/
extern bool has_unique_index(RelOptInfo *rel, AttrNumber attno);
extern Selectivity restriction_selectivity(PlannerInfo *root,
- Oid operator,
+ Oid operatorid,
List *args,
int varRelid);
extern Selectivity join_selectivity(PlannerInfo *root,
- Oid operator,
+ Oid operatorid,
List *args,
JoinType jointype,
SpecialJoinInfo *sjinfo);
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/parser/parse_type.h,v 1.40 2009/01/01 17:24:00 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/parser/parse_type.h,v 1.41 2009/07/16 06:33:45 petere Exp $
*
*-------------------------------------------------------------------------
*/
typedef HeapTuple Type;
-extern Type LookupTypeName(ParseState *pstate, const TypeName *typename,
+extern Type LookupTypeName(ParseState *pstate, const TypeName *typeName,
int32 *typmod_p);
-extern Type typenameType(ParseState *pstate, const TypeName *typename,
+extern Type typenameType(ParseState *pstate, const TypeName *typeName,
int32 *typmod_p);
-extern Oid typenameTypeId(ParseState *pstate, const TypeName *typename,
+extern Oid typenameTypeId(ParseState *pstate, const TypeName *typeName,
int32 *typmod_p);
-extern char *TypeNameToString(const TypeName *typename);
+extern char *TypeNameToString(const TypeName *typeName);
extern char *TypeNameListToString(List *typenames);
extern Type typeidType(Oid id);
*
* 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 $
*
*-------------------------------------------------------------------------
*/
bool isend; /* in: marks for lexize_info about text end is
* reached */
bool getnext; /* out: dict wants next lexeme */
- void *private; /* internal dict state between calls with
+ void *private_state; /* internal dict state between calls with
* getnext == true */
} DictSubState;
*
* 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 $
*
*-------------------------------------------------------------------------
*/
typedef union
{
QueryItemType type;
- QueryOperator operator;
- QueryOperand operand;
+ QueryOperator qoperator;
+ QueryOperand qoperand;
} QueryItem;
/*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
extern void pushValue(TSQueryParserState state,
char *strval, int lenval, int2 weight, bool prefix);
extern void pushStop(TSQueryParserState state);
-extern void pushOperator(TSQueryParserState state, int8 operator);
+extern void pushOperator(TSQueryParserState state, int8 oper);
/*
* parse plain text and lexize words
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/utils/builtins.h,v 1.333 2009/07/07 18:23:15 petere Exp $
+ * $PostgreSQL: pgsql/src/include/utils/builtins.h,v 1.334 2009/07/16 06:33:46 petere Exp $
*
*-------------------------------------------------------------------------
*/
extern List *deparse_context_for_plan(Node *plan, Node *outer_plan,
List *rtable, List *subplans);
extern const char *quote_identifier(const char *ident);
-extern char *quote_qualified_identifier(const char *namespace,
+extern char *quote_qualified_identifier(const char *qualifier,
const char *ident);
/* tid.c */
--- /dev/null
+#!/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