mirror of
https://github.com/postgres/postgres.git
synced 2025-08-22 21:53:06 +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:
@@ -15,7 +15,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.179 2002/04/17 20:57:56 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.180 2002/04/18 20:01:09 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -2380,14 +2380,15 @@ _copyCreateTrigStmt(CreateTrigStmt *from)
|
||||
return newnode;
|
||||
}
|
||||
|
||||
static DropTrigStmt *
|
||||
_copyDropTrigStmt(DropTrigStmt *from)
|
||||
static DropPropertyStmt *
|
||||
_copyDropPropertyStmt(DropPropertyStmt *from)
|
||||
{
|
||||
DropTrigStmt *newnode = makeNode(DropTrigStmt);
|
||||
DropPropertyStmt *newnode = makeNode(DropPropertyStmt);
|
||||
|
||||
if (from->trigname)
|
||||
newnode->trigname = pstrdup(from->trigname);
|
||||
Node_Copy(from, newnode, relation);
|
||||
if (from->property)
|
||||
newnode->property = pstrdup(from->property);
|
||||
newnode->removeType = from->removeType;
|
||||
|
||||
return newnode;
|
||||
}
|
||||
@@ -2915,8 +2916,8 @@ copyObject(void *from)
|
||||
case T_CreateTrigStmt:
|
||||
retval = _copyCreateTrigStmt(from);
|
||||
break;
|
||||
case T_DropTrigStmt:
|
||||
retval = _copyDropTrigStmt(from);
|
||||
case T_DropPropertyStmt:
|
||||
retval = _copyDropPropertyStmt(from);
|
||||
break;
|
||||
case T_CreatePLangStmt:
|
||||
retval = _copyCreatePLangStmt(from);
|
||||
|
@@ -20,7 +20,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.127 2002/04/17 20:57:56 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.128 2002/04/18 20:01:09 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1232,12 +1232,14 @@ _equalCreateTrigStmt(CreateTrigStmt *a, CreateTrigStmt *b)
|
||||
}
|
||||
|
||||
static bool
|
||||
_equalDropTrigStmt(DropTrigStmt *a, DropTrigStmt *b)
|
||||
_equalDropPropertyStmt(DropPropertyStmt *a, DropPropertyStmt *b)
|
||||
{
|
||||
if (!equalstr(a->trigname, b->trigname))
|
||||
return false;
|
||||
if (!equal(a->relation, b->relation))
|
||||
return false;
|
||||
if (!equalstr(a->property, b->property))
|
||||
return false;
|
||||
if (a->removeType != b->removeType)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -2080,8 +2082,8 @@ equal(void *a, void *b)
|
||||
case T_CreateTrigStmt:
|
||||
retval = _equalCreateTrigStmt(a, b);
|
||||
break;
|
||||
case T_DropTrigStmt:
|
||||
retval = _equalDropTrigStmt(a, b);
|
||||
case T_DropPropertyStmt:
|
||||
retval = _equalDropPropertyStmt(a, b);
|
||||
break;
|
||||
case T_CreatePLangStmt:
|
||||
retval = _equalCreatePLangStmt(a, b);
|
||||
|
Reference in New Issue
Block a user