summaryrefslogtreecommitdiff
path: root/src/include/catalog
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-04-18 20:01:11 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-04-18 20:01:11 +0000
commitb3120804ad1692322a6d905b352df7fa0d7cdd80 (patch)
tree93aaf632df82db20e63c952be8a6fd1e4ec15629 /src/include/catalog
parent4e08a625b006ba3992be881b516773adba5863e4 (diff)
downloadpostgresql-b3120804ad1692322a6d905b352df7fa0d7cdd80.tar.gz
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.
Diffstat (limited to 'src/include/catalog')
-rw-r--r--src/include/catalog/catversion.h4
-rw-r--r--src/include/catalog/indexing.h6
-rw-r--r--src/include/catalog/pg_proc.h8
-rw-r--r--src/include/catalog/pg_rewrite.h13
4 files changed, 18 insertions, 13 deletions
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h
index 492c3e9b3f..4d6742fdbd 100644
--- a/src/include/catalog/catversion.h
+++ b/src/include/catalog/catversion.h
@@ -37,7 +37,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: catversion.h,v 1.117 2002/04/17 20:57:56 tgl Exp $
+ * $Id: catversion.h,v 1.118 2002/04/18 20:01:10 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -53,6 +53,6 @@
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 200204171
+#define CATALOG_VERSION_NO 200204181
#endif
diff --git a/src/include/catalog/indexing.h b/src/include/catalog/indexing.h
index b2b3f1f39c..e08e3aa8e9 100644
--- a/src/include/catalog/indexing.h
+++ b/src/include/catalog/indexing.h
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: indexing.h,v 1.64 2002/04/17 20:57:56 tgl Exp $
+ * $Id: indexing.h,v 1.65 2002/04/18 20:01:10 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -80,7 +80,7 @@
#define ProcedureOidIndex "pg_proc_oid_index"
#define RelCheckIndex "pg_relcheck_rcrelid_index"
#define RewriteOidIndex "pg_rewrite_oid_index"
-#define RewriteRulenameIndex "pg_rewrite_rulename_index"
+#define RewriteRelRulenameIndex "pg_rewrite_rel_rulename_index"
#define ShadowNameIndex "pg_shadow_usename_index"
#define ShadowSysidIndex "pg_shadow_usesysid_index"
#define StatisticRelidAttnumIndex "pg_statistic_relid_att_index"
@@ -178,7 +178,7 @@ DECLARE_UNIQUE_INDEX(pg_proc_proname_args_nsp_index on pg_proc using btree(prona
/* This following index is not used for a cache and is not unique */
DECLARE_INDEX(pg_relcheck_rcrelid_index on pg_relcheck using btree(rcrelid oid_ops));
DECLARE_UNIQUE_INDEX(pg_rewrite_oid_index on pg_rewrite using btree(oid oid_ops));
-DECLARE_UNIQUE_INDEX(pg_rewrite_rulename_index on pg_rewrite using btree(rulename name_ops));
+DECLARE_UNIQUE_INDEX(pg_rewrite_rel_rulename_index on pg_rewrite using btree(ev_class oid_ops, rulename name_ops));
DECLARE_UNIQUE_INDEX(pg_shadow_usename_index on pg_shadow using btree(usename name_ops));
DECLARE_UNIQUE_INDEX(pg_shadow_usesysid_index on pg_shadow using btree(usesysid int4_ops));
DECLARE_UNIQUE_INDEX(pg_statistic_relid_att_index on pg_statistic using btree(starelid oid_ops, staattnum int2_ops));
diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h
index a7f77f1f7d..f8863d9340 100644
--- a/src/include/catalog/pg_proc.h
+++ b/src/include/catalog/pg_proc.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_proc.h,v 1.227 2002/04/11 20:00:12 tgl Exp $
+ * $Id: pg_proc.h,v 1.228 2002/04/18 20:01:10 tgl Exp $
*
* NOTES
* The script catalog/genbki.sh reads this file and generates .bki
@@ -2150,9 +2150,11 @@ DATA(insert OID = 1639 ( oidge PGNSP PGUID 12 f t f t f i 2 16 "26 26" 10
DESCR("greater-than-or-equal");
/* System-view support functions */
-DATA(insert OID = 1640 ( pg_get_ruledef PGNSP PGUID 12 f t f t f s 1 25 "19" 100 0 0 100 pg_get_ruledef - _null_ ));
+DATA(insert OID = 1573 ( pg_get_ruledef PGNSP PGUID 12 f t f t f s 1 25 "26" 100 0 0 100 pg_get_ruledef - _null_ ));
DESCR("source text of a rule");
-DATA(insert OID = 1641 ( pg_get_viewdef PGNSP PGUID 12 f t f t f s 1 25 "19" 100 0 0 100 pg_get_viewdef - _null_ ));
+DATA(insert OID = 1640 ( pg_get_viewdef PGNSP PGUID 12 f t f t f s 1 25 "25" 100 0 0 100 pg_get_viewdef_name - _null_ ));
+DESCR("select statement of a view");
+DATA(insert OID = 1641 ( pg_get_viewdef PGNSP PGUID 12 f t f t f s 1 25 "26" 100 0 0 100 pg_get_viewdef - _null_ ));
DESCR("select statement of a view");
DATA(insert OID = 1642 ( pg_get_userbyid PGNSP PGUID 12 f t f t f s 1 19 "23" 100 0 0 100 pg_get_userbyid - _null_ ));
DESCR("user name by UID (with fallback)");
diff --git a/src/include/catalog/pg_rewrite.h b/src/include/catalog/pg_rewrite.h
index 46b73bc083..00b0eb2974 100644
--- a/src/include/catalog/pg_rewrite.h
+++ b/src/include/catalog/pg_rewrite.h
@@ -4,11 +4,14 @@
* definition of the system "rewrite-rule" relation (pg_rewrite)
* along with the relation's initial contents.
*
+ * As of Postgres 7.3, the primary key for this table is <ev_class, rulename>
+ * --- ie, rule names are only unique among the rules of a given table.
+ *
*
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_rewrite.h,v 1.17 2001/11/05 17:46:32 momjian Exp $
+ * $Id: pg_rewrite.h,v 1.18 2002/04/18 20:01:11 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
@@ -34,9 +37,9 @@
CATALOG(pg_rewrite)
{
NameData rulename;
- char ev_type;
Oid ev_class;
int2 ev_attr;
+ char ev_type;
bool is_instead;
/* NB: remaining fields must be accessed via heap_getattr */
@@ -57,9 +60,9 @@ typedef FormData_pg_rewrite *Form_pg_rewrite;
*/
#define Natts_pg_rewrite 7
#define Anum_pg_rewrite_rulename 1
-#define Anum_pg_rewrite_ev_type 2
-#define Anum_pg_rewrite_ev_class 3
-#define Anum_pg_rewrite_ev_attr 4
+#define Anum_pg_rewrite_ev_class 2
+#define Anum_pg_rewrite_ev_attr 3
+#define Anum_pg_rewrite_ev_type 4
#define Anum_pg_rewrite_is_instead 5
#define Anum_pg_rewrite_ev_qual 6
#define Anum_pg_rewrite_ev_action 7