1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-07 19:06:32 +03:00

Rule names are now unique per-relation, rather than unique globally.

DROP RULE and COMMENT ON RULE syntax adds an 'ON tablename' clause,
similar to TRIGGER syntaxes.  To allow loading of existing pg_dump
files containing COMMENT ON RULE, the COMMENT code will still accept
the old syntax --- but only if the target rulename is unique across
the whole database.
This commit is contained in:
Tom Lane
2002-04-18 20:01:11 +00:00
parent 4e08a625b0
commit b3120804ad
35 changed files with 489 additions and 300 deletions

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: parsenodes.h,v 1.171 2002/04/17 20:57:57 tgl Exp $
* $Id: parsenodes.h,v 1.172 2002/04/18 20:01:11 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -940,13 +940,6 @@ typedef struct CreateTrigStmt
RangeVar *constrrel; /* opposite relation */
} CreateTrigStmt;
typedef struct DropTrigStmt
{
NodeTag type;
char *trigname; /* TRIGGER' name */
RangeVar *relation; /* triggered relation */
} DropTrigStmt;
/* ----------------------
* Create/Drop PROCEDURAL LANGUAGE Statement
* ----------------------
@@ -1060,7 +1053,7 @@ typedef struct CreateDomainStmt
} CreateDomainStmt;
/* ----------------------
* Drop Table|Sequence|View|Index|Rule|Type Statement
* Drop Table|Sequence|View|Index|Type|Domain Statement
* ----------------------
*/
@@ -1068,9 +1061,8 @@ typedef struct CreateDomainStmt
#define DROP_SEQUENCE 2
#define DROP_VIEW 3
#define DROP_INDEX 4
#define DROP_RULE 5
#define DROP_TYPE 6
#define DROP_DOMAIN 7
#define DROP_TYPE 5
#define DROP_DOMAIN 6
typedef struct DropStmt
{
@@ -1080,6 +1072,25 @@ typedef struct DropStmt
int behavior; /* CASCADE or RESTRICT drop 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.
* ----------------------
*/
#define DROP_RULE 100
#define DROP_TRIGGER 101
typedef struct DropPropertyStmt
{
NodeTag type;
RangeVar *relation; /* owning relation */
char *property; /* name of rule, trigger, etc */
int removeType;
} DropPropertyStmt;
/* ----------------------
* Truncate Table Statement
* ----------------------