mirror of
https://github.com/postgres/postgres.git
synced 2025-11-06 07:49:08 +03:00
SQL/MED catalog manipulation facilities
This doesn't do any remote or external things yet, but it gives modules like plproxy and dblink a standardized and future-proof system for managing their connection information. Martin Pihlak and Peter Eisentraut
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.383 2008/12/18 18:20:35 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.384 2008/12/19 16:25:19 petere Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -49,6 +49,13 @@ typedef enum SortByNulls
|
||||
SORTBY_NULLS_LAST
|
||||
} SortByNulls;
|
||||
|
||||
/* Alter operations for generic options */
|
||||
typedef enum AlterOptionOp
|
||||
{
|
||||
ALTER_OPT_DROP = -1,
|
||||
ALTER_OPT_SET,
|
||||
ALTER_OPT_ADD
|
||||
} AlterOptionOp;
|
||||
|
||||
/*
|
||||
* Grantable rights are encoded so that we can OR them together in a bitmask.
|
||||
@@ -67,7 +74,7 @@ typedef uint32 AclMode; /* a bitmask of privilege bits */
|
||||
#define ACL_REFERENCES (1<<5)
|
||||
#define ACL_TRIGGER (1<<6)
|
||||
#define ACL_EXECUTE (1<<7) /* for functions */
|
||||
#define ACL_USAGE (1<<8) /* for languages and namespaces */
|
||||
#define ACL_USAGE (1<<8) /* for languages, namespaces, FDWs, and servers */
|
||||
#define ACL_CREATE (1<<9) /* for namespaces and databases */
|
||||
#define ACL_CREATE_TEMP (1<<10) /* for databases */
|
||||
#define ACL_CONNECT (1<<11) /* for databases */
|
||||
@@ -466,6 +473,17 @@ typedef struct DefElem
|
||||
Node *arg; /* a (Value *) or a (TypeName *) */
|
||||
} DefElem;
|
||||
|
||||
/*
|
||||
* Option definition. Used in options definition lists, with optional alter
|
||||
* operation.
|
||||
*/
|
||||
typedef struct OptionDefElem
|
||||
{
|
||||
NodeTag type;
|
||||
AlterOptionOp alter_op; /* Alter operation: ADD/SET/DROP */
|
||||
DefElem *def; /* The actual definition */
|
||||
} OptionDefElem;
|
||||
|
||||
/*
|
||||
* LockingClause - raw representation of FOR UPDATE/SHARE options
|
||||
*
|
||||
@@ -930,6 +948,8 @@ typedef enum ObjectType
|
||||
OBJECT_CONVERSION,
|
||||
OBJECT_DATABASE,
|
||||
OBJECT_DOMAIN,
|
||||
OBJECT_FDW,
|
||||
OBJECT_FOREIGN_SERVER,
|
||||
OBJECT_FUNCTION,
|
||||
OBJECT_INDEX,
|
||||
OBJECT_LANGUAGE,
|
||||
@@ -1076,6 +1096,8 @@ typedef enum GrantObjectType
|
||||
ACL_OBJECT_RELATION, /* table, view */
|
||||
ACL_OBJECT_SEQUENCE, /* sequence */
|
||||
ACL_OBJECT_DATABASE, /* database */
|
||||
ACL_OBJECT_FDW, /* foreign-data wrapper */
|
||||
ACL_OBJECT_FOREIGN_SERVER, /* foreign server */
|
||||
ACL_OBJECT_FUNCTION, /* function */
|
||||
ACL_OBJECT_LANGUAGE, /* procedural language */
|
||||
ACL_OBJECT_NAMESPACE, /* namespace */
|
||||
@@ -1328,6 +1350,96 @@ typedef struct DropTableSpaceStmt
|
||||
bool missing_ok; /* skip error if missing? */
|
||||
} DropTableSpaceStmt;
|
||||
|
||||
/* ----------------------
|
||||
* Create/Drop FOREIGN DATA WRAPPER Statements
|
||||
* ----------------------
|
||||
*/
|
||||
|
||||
typedef struct CreateFdwStmt
|
||||
{
|
||||
NodeTag type;
|
||||
char *fdwname; /* foreign-data wrapper name */
|
||||
char *library; /* libray name */
|
||||
List *options; /* generic options to FDW */
|
||||
} CreateFdwStmt;
|
||||
|
||||
typedef struct AlterFdwStmt
|
||||
{
|
||||
NodeTag type;
|
||||
char *fdwname; /* foreign-data wrapper name */
|
||||
char *library; /* libray name */
|
||||
List *options; /* generic options to FDW */
|
||||
} AlterFdwStmt;
|
||||
|
||||
typedef struct DropFdwStmt
|
||||
{
|
||||
NodeTag type;
|
||||
char *fdwname; /* foreign-data wrapper name */
|
||||
bool missing_ok; /* don't complain if missing */
|
||||
DropBehavior behavior; /* drop behavior - cascade/restrict */
|
||||
} DropFdwStmt;
|
||||
|
||||
/* ----------------------
|
||||
* Create/Drop FOREIGN SERVER Statements
|
||||
* ----------------------
|
||||
*/
|
||||
|
||||
typedef struct CreateForeignServerStmt
|
||||
{
|
||||
NodeTag type;
|
||||
char *servername; /* server name */
|
||||
char *servertype; /* optional server type */
|
||||
char *version; /* optional server version */
|
||||
char *fdwname; /* FDW name */
|
||||
List *options; /* generic options to server */
|
||||
} CreateForeignServerStmt;
|
||||
|
||||
typedef struct AlterForeignServerStmt
|
||||
{
|
||||
NodeTag type;
|
||||
char *servername; /* server name */
|
||||
char *version; /* optional server version */
|
||||
List *options; /* generic options to server */
|
||||
bool has_version; /* version specified */
|
||||
} AlterForeignServerStmt;
|
||||
|
||||
typedef struct DropForeignServerStmt
|
||||
{
|
||||
NodeTag type;
|
||||
char *servername; /* server name */
|
||||
bool missing_ok; /* ignore missing servers */
|
||||
DropBehavior behavior; /* drop behavior - cascade/restrict */
|
||||
} DropForeignServerStmt;
|
||||
|
||||
/* ----------------------
|
||||
* Create/Drop USER MAPPING Statements
|
||||
* ----------------------
|
||||
*/
|
||||
|
||||
typedef struct CreateUserMappingStmt
|
||||
{
|
||||
NodeTag type;
|
||||
char *username; /* username or PUBLIC/CURRENT_USER */
|
||||
char *servername; /* server name */
|
||||
List *options; /* generic options to server */
|
||||
} CreateUserMappingStmt;
|
||||
|
||||
typedef struct AlterUserMappingStmt
|
||||
{
|
||||
NodeTag type;
|
||||
char *username; /* username or PUBLIC/CURRENT_USER */
|
||||
char *servername; /* server name */
|
||||
List *options; /* generic options to server */
|
||||
} AlterUserMappingStmt;
|
||||
|
||||
typedef struct DropUserMappingStmt
|
||||
{
|
||||
NodeTag type;
|
||||
char *username; /* username or PUBLIC/CURRENT_USER */
|
||||
char *servername; /* server name */
|
||||
bool missing_ok; /* ignore missing mappings */
|
||||
} DropUserMappingStmt;
|
||||
|
||||
/* ----------------------
|
||||
* Create/Drop TRIGGER Statements
|
||||
* ----------------------
|
||||
|
||||
Reference in New Issue
Block a user