parsenodes.h
来自「PostgreSQL 8.2中增加了很多企业用户所需要的功能和性能上的提高,其开」· C头文件 代码 · 共 1,961 行 · 第 1/5 页
H
1,961 行
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 */ bool missing_ok; /* skip error if missing? */} 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 */ bool missing_ok; /* skip error if a role is missing? */} 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 */ bool oldstyle; /* hack to signal old CREATE AGG syntax */ List *defnames; /* qualified name (list of Value strings) */ List *args; /* a list of TypeName (if needed) */ 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 */ bool missing_ok; /* skip error if object is missing? */} 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 */ bool missing_ok; /* skip error if a missing? */} DropPropertyStmt;/* ---------------------- * Truncate Table Statement * ---------------------- */typedef struct TruncateStmt{ NodeTag type; List *relations; /* relations (RangeVars) to be truncated */ DropBehavior behavior; /* RESTRICT or CASCADE behavior */} 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 */ List *options; /* options from WITH clause */ 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? */ bool concurrent; /* should this be a concurrent index build? */} 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;typedef enum FunctionParameterMode{ /* the assigned enum values appear in pg_proc, don't change 'em! */ FUNC_PARAM_IN = 'i', /* input only */ FUNC_PARAM_OUT = 'o', /* output only */ FUNC_PARAM_INOUT = 'b' /* both */} FunctionParameterMode;typedef struct FunctionParameter{ NodeTag type; char *name; /* parameter name, or NULL if not given */ TypeName *argType; /* TypeName for parameter type */ FunctionParameterMode mode; /* IN/OUT/INOUT */} FunctionParameter;typedef struct AlterFunctionStmt{ NodeTag type; FuncWithArgs *func; /* name and args of function */ List *actions; /* list of DefElem */} AlterFunctionStmt;/* ---------------------- * Drop {Function|Aggregate|Operator} Statement * ---------------------- */typedef struct RemoveFuncStmt{ NodeTag type; ObjectType kind; /* function, aggregate, operator */ List *name; /* qualified name of object to drop */ List *args; /* types of the arguments */ DropBehavior behavior; /* RESTRICT or CASCADE behavior */ bool missing_ok; /* skip error if a missing? */} RemoveFuncStmt;/* ---------------------- * Drop Operator Class Statement * ---------------------- */typedef struct RemoveOpClassStmt{ NodeTag type; List *opclassname; /* qualified name (list of Value strings) */ char *amname; /* name of index AM opclass is for */ DropBehavior behavior; /* RESTRICT or CASCADE behavior */ bool missing_ok; /* skip error if a missing? */} RemoveOpClassStmt;/* ---------------------- * Alter Object Rename Statement * ---------------------- */typedef struct RenameStmt{ NodeTag type; ObjectType renameType; /* OBJECT_TABLE, OBJECT_COLUMN, etc */ RangeVar *relation; /* in case it's a table */ List *object; /* in case it's some other object */ List *objarg; /* argument types, if applicable */ char *subname; /* name of contained object (column, rule, * trigger, etc) */ char *newname; /* the new name */} RenameStmt;/* ---------------------- * ALTER object SET SCHEMA Statement * ---------------------- */typedef struct AlterObjectSchemaStmt{ NodeTag type; ObjectType objectType; /* OBJECT_TABLE, OBJECT_TYPE, etc */ RangeVar *relation; /* in case it's a table */ List *object; /* in case it's some other object */ List *objarg; /* argument types, if applicable */ char *addname; /* additional name if needed */ char *newschema; /* the new schema */} AlterObjectSchemaStmt;/* ---------------------- * Alter Object Owner Statement
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?