⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 copyfuncs.c

📁 PostgreSQL 8.1.4的源码 适用于Linux下的开源数据库系统
💻 C
📖 第 1 页 / 共 5 页
字号:
}/* **************************************************************** *					parsenodes.h copy functions * **************************************************************** */static RangeTblEntry *_copyRangeTblEntry(RangeTblEntry *from){	RangeTblEntry *newnode = makeNode(RangeTblEntry);	COPY_SCALAR_FIELD(rtekind);	COPY_SCALAR_FIELD(relid);	COPY_NODE_FIELD(subquery);	COPY_NODE_FIELD(funcexpr);	COPY_NODE_FIELD(coldeflist);	COPY_SCALAR_FIELD(jointype);	COPY_NODE_FIELD(joinaliasvars);	COPY_NODE_FIELD(alias);	COPY_NODE_FIELD(eref);	COPY_SCALAR_FIELD(inh);	COPY_SCALAR_FIELD(inFromCl);	COPY_SCALAR_FIELD(requiredPerms);	COPY_SCALAR_FIELD(checkAsUser);	return newnode;}static FkConstraint *_copyFkConstraint(FkConstraint *from){	FkConstraint *newnode = makeNode(FkConstraint);	COPY_STRING_FIELD(constr_name);	COPY_NODE_FIELD(pktable);	COPY_NODE_FIELD(fk_attrs);	COPY_NODE_FIELD(pk_attrs);	COPY_SCALAR_FIELD(fk_matchtype);	COPY_SCALAR_FIELD(fk_upd_action);	COPY_SCALAR_FIELD(fk_del_action);	COPY_SCALAR_FIELD(deferrable);	COPY_SCALAR_FIELD(initdeferred);	COPY_SCALAR_FIELD(skip_validation);	return newnode;}static SortClause *_copySortClause(SortClause *from){	SortClause *newnode = makeNode(SortClause);	COPY_SCALAR_FIELD(tleSortGroupRef);	COPY_SCALAR_FIELD(sortop);	return newnode;}static GroupClause *_copyGroupClause(GroupClause *from){	GroupClause *newnode = makeNode(GroupClause);	COPY_SCALAR_FIELD(tleSortGroupRef);	COPY_SCALAR_FIELD(sortop);	return newnode;}static A_Expr *_copyAExpr(A_Expr *from){	A_Expr	   *newnode = makeNode(A_Expr);	COPY_SCALAR_FIELD(kind);	COPY_NODE_FIELD(name);	COPY_NODE_FIELD(lexpr);	COPY_NODE_FIELD(rexpr);	return newnode;}static ColumnRef *_copyColumnRef(ColumnRef *from){	ColumnRef  *newnode = makeNode(ColumnRef);	COPY_NODE_FIELD(fields);	return newnode;}static ParamRef *_copyParamRef(ParamRef *from){	ParamRef   *newnode = makeNode(ParamRef);	COPY_SCALAR_FIELD(number);	return newnode;}static A_Const *_copyAConst(A_Const *from){	A_Const    *newnode = makeNode(A_Const);	/* This part must duplicate _copyValue */	COPY_SCALAR_FIELD(val.type);	switch (from->val.type)	{		case T_Integer:			COPY_SCALAR_FIELD(val.val.ival);			break;		case T_Float:		case T_String:		case T_BitString:			COPY_STRING_FIELD(val.val.str);			break;		case T_Null:			/* nothing to do */			break;		default:			elog(ERROR, "unrecognized node type: %d",				 (int) from->val.type);			break;	}	COPY_NODE_FIELD(typename);	return newnode;}static FuncCall *_copyFuncCall(FuncCall *from){	FuncCall   *newnode = makeNode(FuncCall);	COPY_NODE_FIELD(funcname);	COPY_NODE_FIELD(args);	COPY_SCALAR_FIELD(agg_star);	COPY_SCALAR_FIELD(agg_distinct);	return newnode;}static A_Indices *_copyAIndices(A_Indices *from){	A_Indices  *newnode = makeNode(A_Indices);	COPY_NODE_FIELD(lidx);	COPY_NODE_FIELD(uidx);	return newnode;}static A_Indirection *_copyA_Indirection(A_Indirection *from){	A_Indirection *newnode = makeNode(A_Indirection);	COPY_NODE_FIELD(arg);	COPY_NODE_FIELD(indirection);	return newnode;}static ResTarget *_copyResTarget(ResTarget *from){	ResTarget  *newnode = makeNode(ResTarget);	COPY_STRING_FIELD(name);	COPY_NODE_FIELD(indirection);	COPY_NODE_FIELD(val);	return newnode;}static TypeName *_copyTypeName(TypeName *from){	TypeName   *newnode = makeNode(TypeName);	COPY_NODE_FIELD(names);	COPY_SCALAR_FIELD(typeid);	COPY_SCALAR_FIELD(timezone);	COPY_SCALAR_FIELD(setof);	COPY_SCALAR_FIELD(pct_type);	COPY_SCALAR_FIELD(typmod);	COPY_NODE_FIELD(arrayBounds);	return newnode;}static SortBy *_copySortBy(SortBy *from){	SortBy	   *newnode = makeNode(SortBy);	COPY_SCALAR_FIELD(sortby_kind);	COPY_NODE_FIELD(useOp);	COPY_NODE_FIELD(node);	return newnode;}static RangeSubselect *_copyRangeSubselect(RangeSubselect *from){	RangeSubselect *newnode = makeNode(RangeSubselect);	COPY_NODE_FIELD(subquery);	COPY_NODE_FIELD(alias);	return newnode;}static RangeFunction *_copyRangeFunction(RangeFunction *from){	RangeFunction *newnode = makeNode(RangeFunction);	COPY_NODE_FIELD(funccallnode);	COPY_NODE_FIELD(alias);	COPY_NODE_FIELD(coldeflist);	return newnode;}static TypeCast *_copyTypeCast(TypeCast *from){	TypeCast   *newnode = makeNode(TypeCast);	COPY_NODE_FIELD(arg);	COPY_NODE_FIELD(typename);	return newnode;}static IndexElem *_copyIndexElem(IndexElem *from){	IndexElem  *newnode = makeNode(IndexElem);	COPY_STRING_FIELD(name);	COPY_NODE_FIELD(expr);	COPY_NODE_FIELD(opclass);	return newnode;}static ColumnDef *_copyColumnDef(ColumnDef *from){	ColumnDef  *newnode = makeNode(ColumnDef);	COPY_STRING_FIELD(colname);	COPY_NODE_FIELD(typename);	COPY_SCALAR_FIELD(inhcount);	COPY_SCALAR_FIELD(is_local);	COPY_SCALAR_FIELD(is_not_null);	COPY_NODE_FIELD(raw_default);	COPY_STRING_FIELD(cooked_default);	COPY_NODE_FIELD(constraints);	COPY_NODE_FIELD(support);	return newnode;}static Constraint *_copyConstraint(Constraint *from){	Constraint *newnode = makeNode(Constraint);	COPY_SCALAR_FIELD(contype);	COPY_STRING_FIELD(name);	COPY_NODE_FIELD(raw_expr);	COPY_STRING_FIELD(cooked_expr);	COPY_NODE_FIELD(keys);	COPY_STRING_FIELD(indexspace);	return newnode;}static DefElem *_copyDefElem(DefElem *from){	DefElem    *newnode = makeNode(DefElem);	COPY_STRING_FIELD(defname);	COPY_NODE_FIELD(arg);	return newnode;}static LockingClause *_copyLockingClause(LockingClause *from){	LockingClause *newnode = makeNode(LockingClause);	COPY_NODE_FIELD(lockedRels);	COPY_SCALAR_FIELD(forUpdate);	COPY_SCALAR_FIELD(nowait);	return newnode;}static Query *_copyQuery(Query *from){	Query	   *newnode = makeNode(Query);	COPY_SCALAR_FIELD(commandType);	COPY_SCALAR_FIELD(querySource);	COPY_SCALAR_FIELD(canSetTag);	COPY_NODE_FIELD(utilityStmt);	COPY_SCALAR_FIELD(resultRelation);	COPY_NODE_FIELD(into);	COPY_SCALAR_FIELD(intoHasOids);	COPY_SCALAR_FIELD(hasAggs);	COPY_SCALAR_FIELD(hasSubLinks);	COPY_NODE_FIELD(rtable);	COPY_NODE_FIELD(jointree);	COPY_NODE_FIELD(rowMarks);	COPY_SCALAR_FIELD(forUpdate);	COPY_SCALAR_FIELD(rowNoWait);	COPY_NODE_FIELD(targetList);	COPY_NODE_FIELD(groupClause);	COPY_NODE_FIELD(havingQual);	COPY_NODE_FIELD(distinctClause);	COPY_NODE_FIELD(sortClause);	COPY_NODE_FIELD(limitOffset);	COPY_NODE_FIELD(limitCount);	COPY_NODE_FIELD(setOperations);	COPY_NODE_FIELD(resultRelations);	return newnode;}static InsertStmt *_copyInsertStmt(InsertStmt *from){	InsertStmt *newnode = makeNode(InsertStmt);	COPY_NODE_FIELD(relation);	COPY_NODE_FIELD(cols);	COPY_NODE_FIELD(targetList);	COPY_NODE_FIELD(selectStmt);	return newnode;}static DeleteStmt *_copyDeleteStmt(DeleteStmt *from){	DeleteStmt *newnode = makeNode(DeleteStmt);	COPY_NODE_FIELD(relation);	COPY_NODE_FIELD(whereClause);	COPY_NODE_FIELD(usingClause);	return newnode;}static UpdateStmt *_copyUpdateStmt(UpdateStmt *from){	UpdateStmt *newnode = makeNode(UpdateStmt);	COPY_NODE_FIELD(relation);	COPY_NODE_FIELD(targetList);	COPY_NODE_FIELD(whereClause);	COPY_NODE_FIELD(fromClause);	return newnode;}static SelectStmt *_copySelectStmt(SelectStmt *from){	SelectStmt *newnode = makeNode(SelectStmt);	COPY_NODE_FIELD(distinctClause);	COPY_NODE_FIELD(into);	COPY_NODE_FIELD(intoColNames);	COPY_SCALAR_FIELD(intoHasOids);	COPY_NODE_FIELD(targetList);	COPY_NODE_FIELD(fromClause);	COPY_NODE_FIELD(whereClause);	COPY_NODE_FIELD(groupClause);	COPY_NODE_FIELD(havingClause);	COPY_NODE_FIELD(sortClause);	COPY_NODE_FIELD(limitOffset);	COPY_NODE_FIELD(limitCount);	COPY_NODE_FIELD(lockingClause);	COPY_SCALAR_FIELD(op);	COPY_SCALAR_FIELD(all);	COPY_NODE_FIELD(larg);	COPY_NODE_FIELD(rarg);	return newnode;}static SetOperationStmt *_copySetOperationStmt(SetOperationStmt *from){	SetOperationStmt *newnode = makeNode(SetOperationStmt);	COPY_SCALAR_FIELD(op);	COPY_SCALAR_FIELD(all);	COPY_NODE_FIELD(larg);	COPY_NODE_FIELD(rarg);	COPY_NODE_FIELD(colTypes);	return newnode;}static AlterTableStmt *_copyAlterTableStmt(AlterTableStmt *from){	AlterTableStmt *newnode = makeNode(AlterTableStmt);	COPY_NODE_FIELD(relation);	COPY_NODE_FIELD(cmds);	COPY_SCALAR_FIELD(relkind);	return newnode;}static AlterTableCmd *_copyAlterTableCmd(AlterTableCmd *from){	AlterTableCmd *newnode = makeNode(AlterTableCmd);	COPY_SCALAR_FIELD(subtype);	COPY_STRING_FIELD(name);	COPY_NODE_FIELD(def);	COPY_NODE_FIELD(transform);	COPY_SCALAR_FIELD(behavior);	return newnode;}static AlterDomainStmt *_copyAlterDomainStmt(AlterDomainStmt *from){	AlterDomainStmt *newnode = makeNode(AlterDomainStmt);	COPY_SCALAR_FIELD(subtype);	COPY_NODE_FIELD(typename);	COPY_STRING_FIELD(name);	COPY_NODE_FIELD(def);	COPY_SCALAR_FIELD(behavior);	return newnode;}static GrantStmt *_copyGrantStmt(GrantStmt *from){	GrantStmt  *newnode = makeNode(GrantStmt);	COPY_SCALAR_FIELD(is_grant);	COPY_SCALAR_FIELD(objtype);	COPY_NODE_FIELD(objects);	COPY_NODE_FIELD(privileges);	COPY_NODE_FIELD(grantees);	COPY_SCALAR_FIELD(grant_option);	COPY_SCALAR_FIELD(behavior);	return newnode;}static PrivGrantee *_copyPrivGrantee(PrivGrantee *from){	PrivGrantee *newnode = makeNode(PrivGrantee);	COPY_STRING_FIELD(rolname);	return newnode;}static FuncWithArgs *_copyFuncWithArgs(FuncWithArgs *from){	FuncWithArgs *newnode = makeNode(FuncWithArgs);	COPY_NODE_FIELD(funcname);	COPY_NODE_FIELD(funcargs);	return newnode;}static GrantRoleStmt *_copyGrantRoleStmt(GrantRoleStmt *from){	GrantRoleStmt *newnode = makeNode(GrantRoleStmt);	COPY_NODE_FIELD(granted_roles);	COPY_NODE_FIELD(grantee_roles);	COPY_SCALAR_FIELD(is_grant);	COPY_SCALAR_FIELD(admin_opt);	COPY_STRING_FIELD(grantor);	COPY_SCALAR_FIELD(behavior);	return newnode;}static DeclareCursorStmt *_copyDeclareCursorStmt(DeclareCursorStmt *from){	DeclareCursorStmt *newnode = makeNode(DeclareCursorStmt);	COPY_STRING_FIELD(portalname);	COPY_SCALAR_FIELD(options);	COPY_NODE_FIELD(query);	return newnode;}static ClosePortalStmt *_copyClosePortalStmt(ClosePortalStmt *from){	ClosePortalStmt *newnode = makeNode(ClosePortalStmt);	COPY_STRING_FIELD(portalname);	return newnode;}static ClusterStmt *_copyClusterStmt(ClusterStmt *from){	ClusterStmt *newnode = makeNode(ClusterStmt);	COPY_NODE_FIELD(relation);	COPY_STRING_FIELD(indexname);	return newnode;}static CopyStmt *_copyCopyStmt(CopyStmt *from){	CopyStmt   *newnode = makeNode(CopyStmt);	COPY_NODE_FIELD(relation);	COPY_NODE_FIELD(attlist);	COPY_SCALAR_FIELD(is_from);	COPY_STRING_FIELD(filename);	COPY_NODE_FIELD(options);	return newnode;}static CreateStmt *_copyCreateStmt(CreateStmt *from){	CreateStmt *newnode = makeNode(CreateStmt);	COPY_NODE_FIELD(relation);	COPY_NODE_FIELD(tableElts);	COPY_NODE_FIELD(inhRelations);	COPY_NODE_FIELD(constraints);	COPY_SCALAR_FIELD(hasoids);	COPY_SCALAR_FIELD(oncommit);	COPY_STRING_FIELD(tablespacename);	return newnode;}static InhRelation *_copyInhRelation(InhRelation *from){	InhRelation *newnode = makeNode(InhRelation);	COPY_NODE_FIELD(relation);	COPY_SCALAR_FIELD(including_defaults);	return newnode;}static DefineStmt *_copyDefineStmt(DefineStmt *from){	DefineStmt *newnode = makeNode(DefineStmt);	COPY_SCALAR_FIELD(kind);	COPY_NODE_FIELD(defnames);	COPY_NODE_FIELD(definition);	return newnode;}static DropStmt *_copyDropStmt(DropStmt *from){	DropStmt   *newnode = makeNode(DropStmt);	COPY_NODE_FIELD(objects);	COPY_SCALAR_FIELD(removeType);	COPY_SCALAR_FIELD(behavior);	return newnode;}static TruncateStmt *_copyTruncateStmt(TruncateStmt *from){	TruncateStmt *newnode = makeNode(TruncateStmt);	COPY_NODE_FIELD(relations);	return newnode;}static CommentStmt *_copyCommentStmt(CommentStmt *from){	CommentStmt *newnode = makeNode(CommentStmt);	COPY_SCALAR_FIELD(objtype);	COPY_NODE_FIELD(objname);	COPY_NODE_FIELD(objargs);	COPY_STRING_FIELD(comment);	return newnode;}static FetchStmt *_copyFetchStmt(FetchStmt *from){	FetchStmt  *newnode = makeNode(FetchStmt);	COPY_SCALAR_FIELD(direction);	COPY_SCALAR_FIELD(howMany);	COPY_STRING_FIELD(portalname);	COPY_SCALAR_FIELD(ismove);	return newnode;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -