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

📄 parsenodes.h

📁 PostgreSQL 8.1.4的源码 适用于Linux下的开源数据库系统
💻 H
📖 第 1 页 / 共 4 页
字号:
{	NodeTag		type;	List	   *granted_roles;	/* list of roles to be granted/revoked */	List	   *grantee_roles;	/* list of member roles to add/delete */	bool		is_grant;		/* true = GRANT, false = REVOKE */	bool		admin_opt;		/* with admin option */	char	   *grantor;		/* set grantor to other than current role */	DropBehavior behavior;		/* drop behavior (for REVOKE) */} GrantRoleStmt;/* ---------------------- *		Copy Statement * ---------------------- */typedef struct CopyStmt{	NodeTag		type;	RangeVar   *relation;		/* the relation to copy */	List	   *attlist;		/* List of column names (as Strings), or NIL								 * for all columns */	bool		is_from;		/* TO or FROM */	char	   *filename;		/* if NULL, use stdin/stdout */	List	   *options;		/* List of DefElem nodes */} CopyStmt;/* ---------------------- *		Create Table Statement * * NOTE: in the raw gram.y output, ColumnDef, Constraint, and FkConstraint * nodes are intermixed in tableElts, and constraints is NIL.  After parse * analysis, tableElts contains just ColumnDefs, and constraints contains * just Constraint nodes (in fact, only CONSTR_CHECK nodes, in the present * implementation). * ---------------------- *//* What to do at commit time for temporary relations */typedef enum OnCommitAction{	ONCOMMIT_NOOP,				/* No ON COMMIT clause (do nothing) */	ONCOMMIT_PRESERVE_ROWS,		/* ON COMMIT PRESERVE ROWS (do nothing) */	ONCOMMIT_DELETE_ROWS,		/* ON COMMIT DELETE ROWS */	ONCOMMIT_DROP				/* ON COMMIT DROP */} OnCommitAction;typedef struct CreateStmt{	NodeTag		type;	RangeVar   *relation;		/* relation to create */	List	   *tableElts;		/* column definitions (list of ColumnDef) */	List	   *inhRelations;	/* relations to inherit from (list of								 * inhRelation) */	List	   *constraints;	/* constraints (list of Constraint nodes) */	ContainsOids hasoids;		/* should it have OIDs? */	OnCommitAction oncommit;	/* what do we do at COMMIT? */	char	   *tablespacename; /* table space to use, or NULL */} CreateStmt;/* ---------- * Definitions for plain (non-FOREIGN KEY) constraints in CreateStmt * * XXX probably these ought to be unified with FkConstraints at some point? * To this end we include CONSTR_FOREIGN in the ConstrType enum, even though * the parser does not generate it. * * For constraints that use expressions (CONSTR_DEFAULT, CONSTR_CHECK) * we may have the expression in either "raw" form (an untransformed * parse tree) or "cooked" form (the nodeToString representation of * an executable expression tree), depending on how this Constraint * node was created (by parsing, or by inheritance from an existing * relation).  We should never have both in the same node! * * Constraint attributes (DEFERRABLE etc) are initially represented as * separate Constraint nodes for simplicity of parsing.  analyze.c makes * a pass through the constraints list to attach the info to the appropriate * FkConstraint node (and, perhaps, someday to other kinds of constraints). * ---------- */typedef enum ConstrType			/* types of constraints */{	CONSTR_NULL,				/* not SQL92, but a lot of people expect it */	CONSTR_NOTNULL,	CONSTR_DEFAULT,	CONSTR_CHECK,	CONSTR_FOREIGN,	CONSTR_PRIMARY,	CONSTR_UNIQUE,	CONSTR_ATTR_DEFERRABLE,		/* attributes for previous constraint node */	CONSTR_ATTR_NOT_DEFERRABLE,	CONSTR_ATTR_DEFERRED,	CONSTR_ATTR_IMMEDIATE} ConstrType;typedef struct Constraint{	NodeTag		type;	ConstrType	contype;	char	   *name;			/* name, or NULL if unnamed */	Node	   *raw_expr;		/* expr, as untransformed parse tree */	char	   *cooked_expr;	/* expr, as nodeToString representation */	List	   *keys;			/* String nodes naming referenced column(s) */	char	   *indexspace;		/* index tablespace for PKEY/UNIQUE								 * constraints; NULL for default */} Constraint;/* ---------- * Definitions for FOREIGN KEY constraints in CreateStmt * * Note: FKCONSTR_ACTION_xxx values are stored into pg_constraint.confupdtype * and pg_constraint.confdeltype columns; FKCONSTR_MATCH_xxx values are * stored into pg_constraint.confmatchtype.  Changing the code values may * require an initdb! * * If skip_validation is true then we skip checking that the existing rows * in the table satisfy the constraint, and just install the catalog entries * for the constraint.	This is currently used only during CREATE TABLE * (when we know the table must be empty). * ---------- */#define FKCONSTR_ACTION_NOACTION	'a'#define FKCONSTR_ACTION_RESTRICT	'r'#define FKCONSTR_ACTION_CASCADE		'c'#define FKCONSTR_ACTION_SETNULL		'n'#define FKCONSTR_ACTION_SETDEFAULT	'd'#define FKCONSTR_MATCH_FULL			'f'#define FKCONSTR_MATCH_PARTIAL		'p'#define FKCONSTR_MATCH_UNSPECIFIED	'u'typedef struct FkConstraint{	NodeTag		type;	char	   *constr_name;	/* Constraint name, or NULL if unnamed */	RangeVar   *pktable;		/* Primary key table */	List	   *fk_attrs;		/* Attributes of foreign key */	List	   *pk_attrs;		/* Corresponding attrs in PK table */	char		fk_matchtype;	/* FULL, PARTIAL, UNSPECIFIED */	char		fk_upd_action;	/* ON UPDATE action */	char		fk_del_action;	/* ON DELETE action */	bool		deferrable;		/* DEFERRABLE */	bool		initdeferred;	/* INITIALLY DEFERRED */	bool		skip_validation;	/* skip validation of existing rows? */} FkConstraint;/* ---------------------- *		Create/Drop Table Space Statements * ---------------------- */typedef struct CreateTableSpaceStmt{	NodeTag		type;	char	   *tablespacename;	char	   *owner;	char	   *location;} CreateTableSpaceStmt;typedef struct DropTableSpaceStmt{	NodeTag		type;	char	   *tablespacename;} DropTableSpaceStmt;/* ---------------------- *		Create/Drop TRIGGER Statements * ---------------------- */typedef struct CreateTrigStmt{	NodeTag		type;	char	   *trigname;		/* TRIGGER's name */	RangeVar   *relation;		/* relation trigger is on */	List	   *funcname;		/* qual. name of function to call */	List	   *args;			/* list of (T_String) Values or NIL */	bool		before;			/* BEFORE/AFTER */	bool		row;			/* ROW/STATEMENT */	char		actions[4];		/* 1 to 3 of 'i', 'u', 'd', + trailing \0 */	/* The following are used for referential */	/* integrity constraint triggers */	bool		isconstraint;	/* This is an RI trigger */	bool		deferrable;		/* [NOT] DEFERRABLE */	bool		initdeferred;	/* INITIALLY {DEFERRED|IMMEDIATE} */	RangeVar   *constrrel;		/* opposite relation */} CreateTrigStmt;/* ---------------------- *		Create/Drop PROCEDURAL LANGUAGE Statement * ---------------------- */typedef struct CreatePLangStmt{	NodeTag		type;	char	   *plname;			/* PL name */	List	   *plhandler;		/* PL call handler function (qual. name) */	List	   *plvalidator;	/* optional validator function (qual. name) */	bool		pltrusted;		/* PL is trusted */} CreatePLangStmt;typedef struct DropPLangStmt{	NodeTag		type;	char	   *plname;			/* PL name */	DropBehavior behavior;		/* RESTRICT or CASCADE behavior */} DropPLangStmt;/* ---------------------- *	Create/Alter/Drop Role Statements * * Note: these node types are also used for the backwards-compatible * Create/Alter/Drop User/Group statements.  In the ALTER and DROP cases * there's really no need to distinguish what the original spelling was, * but for CREATE we mark the type because the defaults vary. * ---------------------- */typedef enum RoleStmtType{	ROLESTMT_ROLE,	ROLESTMT_USER,	ROLESTMT_GROUP} RoleStmtType;typedef struct CreateRoleStmt{	NodeTag		type;	RoleStmtType stmt_type;		/* ROLE/USER/GROUP */	char	   *role;			/* role name */	List	   *options;		/* List of DefElem nodes */} CreateRoleStmt;typedef struct AlterRoleStmt{	NodeTag		type;	char	   *role;			/* role name */	List	   *options;		/* List of DefElem nodes */	int			action;			/* +1 = add members, -1 = drop members */} AlterRoleStmt;typedef struct AlterRoleSetStmt{	NodeTag		type;	char	   *role;			/* role name */	char	   *variable;		/* GUC variable name */	List	   *value;			/* value for variable, or NIL for Reset */} AlterRoleSetStmt;typedef struct DropRoleStmt{	NodeTag		type;	List	   *roles;			/* List of roles to remove */} DropRoleStmt;/* ---------------------- *		{Create|Alter} SEQUENCE Statement * ---------------------- */typedef struct CreateSeqStmt{	NodeTag		type;	RangeVar   *sequence;		/* the sequence to create */	List	   *options;} CreateSeqStmt;typedef struct AlterSeqStmt{	NodeTag		type;	RangeVar   *sequence;		/* the sequence to alter */	List	   *options;} AlterSeqStmt;/* ---------------------- *		Create {Aggregate|Operator|Type} Statement * ---------------------- */typedef struct DefineStmt{	NodeTag		type;	ObjectType	kind;			/* aggregate, operator, type */	List	   *defnames;		/* qualified name (list of Value strings) */	List	   *definition;		/* a list of DefElem */} DefineStmt;/* ---------------------- *		Create Domain Statement * ---------------------- */typedef struct CreateDomainStmt{	NodeTag		type;	List	   *domainname;		/* qualified name (list of Value strings) */	TypeName   *typename;		/* the base type */	List	   *constraints;	/* constraints (list of Constraint nodes) */} CreateDomainStmt;/* ---------------------- *		Create Operator Class Statement * ---------------------- */typedef struct CreateOpClassStmt{	NodeTag		type;	List	   *opclassname;	/* qualified name (list of Value strings) */	char	   *amname;			/* name of index AM opclass is for */	TypeName   *datatype;		/* datatype of indexed column */	List	   *items;			/* List of CreateOpClassItem nodes */	bool		isDefault;		/* Should be marked as default for type? */} CreateOpClassStmt;#define OPCLASS_ITEM_OPERATOR		1#define OPCLASS_ITEM_FUNCTION		2#define OPCLASS_ITEM_STORAGETYPE	3typedef struct CreateOpClassItem{	NodeTag		type;	int			itemtype;		/* see codes above */	/* fields used for an operator or function item: */	List	   *name;			/* operator or function name */	List	   *args;			/* argument types */	int			number;			/* strategy num or support proc num */	bool		recheck;		/* only used for operators */	/* fields used for a storagetype item: */	TypeName   *storedtype;		/* datatype stored in index */} CreateOpClassItem;/* ---------------------- *		Drop Table|Sequence|View|Index|Type|Domain|Conversion|Schema Statement * ---------------------- */typedef struct DropStmt{	NodeTag		type;	List	   *objects;		/* list of sublists of names (as Values) */	ObjectType	removeType;		/* object type */	DropBehavior behavior;		/* RESTRICT or CASCADE behavior */} DropStmt;/* ---------------------- *		Drop Rule|Trigger Statement * * In general this may be used for dropping any property of a relation; * for example, someday soon we may have DROP ATTRIBUTE. * ---------------------- */typedef struct DropPropertyStmt{	NodeTag		type;	RangeVar   *relation;		/* owning relation */	char	   *property;		/* name of rule, trigger, etc */	ObjectType	removeType;		/* OBJECT_RULE or OBJECT_TRIGGER */	DropBehavior behavior;		/* RESTRICT or CASCADE behavior */} DropPropertyStmt;/* ---------------------- *				Truncate Table Statement * ---------------------- */typedef struct TruncateStmt{	NodeTag		type;	List	   *relations;		/* relations (RangeVars) to be truncated */} TruncateStmt;/* ---------------------- *				Comment On Statement * ---------------------- */typedef struct CommentStmt{	NodeTag		type;	ObjectType	objtype;		/* Object's type */	List	   *objname;		/* Qualified name of the object */	List	   *objargs;		/* Arguments if needed (eg, for functions) */	char	   *comment;		/* Comment to insert, or NULL to remove */} CommentStmt;/* ---------------------- *		Declare Cursor Statement * ---------------------- */#define CURSOR_OPT_BINARY		0x0001#define CURSOR_OPT_SCROLL		0x0002#define CURSOR_OPT_NO_SCROLL	0x0004#define CURSOR_OPT_INSENSITIVE	0x0008#define CURSOR_OPT_HOLD			0x0010typedef struct DeclareCursorStmt{	NodeTag		type;	char	   *portalname;		/* name of the portal (cursor) */	int			options;		/* bitmask of options (see above) */	Node	   *query;			/* the SELECT query */} DeclareCursorStmt;/* ---------------------- *		Close Portal Statement * ---------------------- */typedef struct ClosePortalStmt{	NodeTag		type;	char	   *portalname;		/* name of the portal (cursor) */} ClosePortalStmt;/* ---------------------- *		Fetch Statement (also Move) * ---------------------- */typedef enum FetchDirection{	/* for these, howMany is how many rows to fetch; FETCH_ALL means ALL */	FETCH_FORWARD,	FETCH_BACKWARD,	/* for these, howMany indicates a position; only one row is fetched */	FETCH_ABSOLUTE,	FETCH_RELATIVE} FetchDirection;#define FETCH_ALL	LONG_MAXtypedef struct FetchStmt{	NodeTag		type;	FetchDirection direction;	/* see above */	long		howMany;		/* number of rows, or position argument */	char	   *portalname;		/* name of portal (cursor) */	bool		ismove;			/* TRUE if MOVE */} FetchStmt;/* ---------------------- *		Create Index Statement * ---------------------- */typedef struct IndexStmt{	NodeTag		type;	char	   *idxname;		/* name of new index, or NULL for default */	RangeVar   *relation;		/* relation to build index on */	char	   *accessMethod;	/* name of access method (eg. btree) */	char	   *tableSpace;		/* tablespace, or NULL to use parent's */	List	   *indexParams;	/* a list of IndexElem */	Node	   *whereClause;	/* qualification (partial-index predicate) */	List	   *rangetable;		/* range table for qual and/or expressions,								 * filled in by transformStmt() */	bool		unique;			/* is index unique? */	bool		primary;		/* is index on primary key? */	bool		isconstraint;	/* is it from a CONSTRAINT clause? */} IndexStmt;/* ---------------------- *		Create Function Statement * ---------------------- */typedef struct CreateFunctionStmt{	NodeTag		type;	bool		replace;		/* T => replace if already exists */	List	   *funcname;		/* qualified name of function to create */	List	   *parameters;		/* a list of FunctionParameter */	TypeName   *returnType;		/* the return type */	List	   *options;		/* a list of DefElem */	List	   *withClause;		/* a list of DefElem */} CreateFunctionStmt;

⌨️ 快捷键说明

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