aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2009-05-27 20:42:29 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2009-05-27 20:42:29 +0000
commit6ec0753146c5ca69a9f1b9eee229c8fa7a55b2b0 (patch)
tree9b0e0c056568c8cd61cba23e65a4d1b73fb19ce5 /src
parent9873db6646a19753df17cc1e32f6046bdfb74938 (diff)
downloadpostgresql-6ec0753146c5ca69a9f1b9eee229c8fa7a55b2b0.tar.gz
postgresql-6ec0753146c5ca69a9f1b9eee229c8fa7a55b2b0.zip
Ignore RECHECK in CREATE OPERATOR CLASS, just throwing a NOTICE, instead of
throwing an error as 8.4 had been doing. The error interfered with porting old database definitions (particularly for pg_migrator) without really buying any safety. Per bug #4817 and subsequent discussion.
Diffstat (limited to 'src')
-rw-r--r--src/backend/parser/gram.y11
-rw-r--r--src/bin/pg_dump/pg_dump.c14
2 files changed, 17 insertions, 8 deletions
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index 7e2609eecc1..544b69246ed 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.663 2009/04/28 09:09:41 heikki Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.664 2009/05/27 20:42:29 tgl Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -3639,9 +3639,14 @@ opt_opfamily: FAMILY any_name { $$ = $2; }
opt_recheck: RECHECK
{
- ereport(ERROR,
+ /*
+ * RECHECK no longer does anything in opclass definitions,
+ * but we still accept it to ease porting of old database
+ * dumps.
+ */
+ ereport(NOTICE,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("RECHECK is no longer supported"),
+ errmsg("RECHECK is no longer required"),
errhint("Update your data type."),
scanner_errposition(@1)));
$$ = TRUE;
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index ccb54e5929d..218c6f214a9 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -12,7 +12,7 @@
* by PostgreSQL
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.537 2009/05/26 17:36:05 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.538 2009/05/27 20:42:29 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -8159,8 +8159,10 @@ dumpOpclass(Archive *fout, OpclassInfo *opcinfo)
* pg_depend entries.
*
* XXX RECHECK is gone as of 8.4, but we'll still print it if dumping
- * an older server's table in which it is used. Would it be better
- * to silently ignore it?
+ * an older server's opclass in which it is used. This is to avoid
+ * hard-to-detect breakage if a newer pg_dump is used to dump from
+ * an older server and then reload into that old version. This can
+ * go away once 8.3 is so old as to not be of interest to anyone.
*/
appendPQExpBuffer(query, "SELECT amopstrategy, false AS amopreqcheck, "
"amopopr::pg_catalog.regoperator "
@@ -8370,8 +8372,10 @@ dumpOpfamily(Archive *fout, OpfamilyInfo *opfinfo)
{
/*
* XXX RECHECK is gone as of 8.4, but we'll still print it if dumping
- * an older server's table in which it is used. Would it be better
- * to silently ignore it?
+ * an older server's opclass in which it is used. This is to avoid
+ * hard-to-detect breakage if a newer pg_dump is used to dump from
+ * an older server and then reload into that old version. This can
+ * go away once 8.3 is so old as to not be of interest to anyone.
*/
appendPQExpBuffer(query, "SELECT amopstrategy, false AS amopreqcheck, "
"amopopr::pg_catalog.regoperator "