diff options
| author | Alvaro Herrera | 2016-04-05 21:38:54 +0000 |
|---|---|---|
| committer | Alvaro Herrera | 2016-04-05 21:38:54 +0000 |
| commit | f2fcad27d59c8e5c48f8fa0a96c8355e40f24273 (patch) | |
| tree | 8630b838513cbd3e2d846a68bf9db6a5f2f9c7b1 /src/include/nodes | |
| parent | 41ea0c23761ca108e2f08f6e3151e3cb1f9652a1 (diff) | |
Support ALTER THING .. DEPENDS ON EXTENSION
This introduces a new dependency type which marks an object as depending
on an extension, such that if the extension is dropped, the object
automatically goes away; and also, if the database is dumped, the object
is included in the dump output. Currently the grammar supports this for
indexes, triggers, materialized views and functions only, although the
utility code is generic so adding support for more object types is a
matter of touching the parser rules only.
Author: Abhijit Menon-Sen
Reviewed-by: Alexander Korotkov, Álvaro Herrera
Discussion: http://www.postgresql.org/message-id/20160115062649.GA5068@toroid.org
Diffstat (limited to 'src/include/nodes')
| -rw-r--r-- | src/include/nodes/nodes.h | 1 | ||||
| -rw-r--r-- | src/include/nodes/parsenodes.h | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h index 734df771eb2..d888b41fd98 100644 --- a/src/include/nodes/nodes.h +++ b/src/include/nodes/nodes.h @@ -368,6 +368,7 @@ typedef enum NodeTag T_DeclareCursorStmt, T_CreateTableSpaceStmt, T_DropTableSpaceStmt, + T_AlterObjectDependsStmt, T_AlterObjectSchemaStmt, T_AlterOwnerStmt, T_AlterOperatorStmt, diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index 8b958b422cb..714cf1550fd 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -2536,6 +2536,20 @@ typedef struct RenameStmt } RenameStmt; /* ---------------------- + * ALTER object DEPENDS ON EXTENSION extname + * ---------------------- + */ +typedef struct AlterObjectDependsStmt +{ + NodeTag type; + ObjectType objectType; /* OBJECT_FUNCTION, OBJECT_TRIGGER, etc */ + RangeVar *relation; /* in case a table is involved */ + List *objname; /* name of the object */ + List *objargs; /* argument types, if applicable */ + Value *extname; /* extension name */ +} AlterObjectDependsStmt; + +/* ---------------------- * ALTER object SET SCHEMA Statement * ---------------------- */ |
