1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-30 21:42:05 +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

@ -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);