From 84aa8ba128a08e6fdebb2497c7a79ebf18093e12 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Wed, 10 Sep 2014 16:54:40 -0400 Subject: Issue a warning during the creation of hash indexes --- src/backend/commands/indexcmds.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/backend/commands/indexcmds.c') diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c index fdfa6ca4f5c..1afe02bd85a 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -489,6 +489,10 @@ DefineIndex(Oid relationId, accessMethodId = HeapTupleGetOid(tuple); accessMethodForm = (Form_pg_am) GETSTRUCT(tuple); + if (strcmp(accessMethodName, "hash") == 0) + ereport(WARNING, + (errmsg("hash indexes are not WAL-logged so they are not crash-safe and cannot be used on streaming standbys"))); + if (stmt->unique && !accessMethodForm->amcanunique) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), -- cgit v1.2.3