aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/indexcmds.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2015-06-26 11:37:32 -0400
committerRobert Haas <rhaas@postgresql.org>2015-06-26 11:37:32 -0400
commit9043ef390f4f0b4586cfe59cbd22314b9c3e2957 (patch)
tree935627e8bf0038034686ce907da470aafb492f45 /src/backend/commands/indexcmds.c
parent91118f1a59f2038f072552fdbb98e01363e30b59 (diff)
downloadpostgresql-9043ef390f4f0b4586cfe59cbd22314b9c3e2957.tar.gz
postgresql-9043ef390f4f0b4586cfe59cbd22314b9c3e2957.zip
Don't warn about creating temporary or unlogged hash indexes.
Warning people that no WAL-logging will be done doesn't make sense in this case. Michael Paquier
Diffstat (limited to 'src/backend/commands/indexcmds.c')
-rw-r--r--src/backend/commands/indexcmds.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 7340a1fc2bb..b450bcf754e 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -490,7 +490,8 @@ DefineIndex(Oid relationId,
accessMethodId = HeapTupleGetOid(tuple);
accessMethodForm = (Form_pg_am) GETSTRUCT(tuple);
- if (strcmp(accessMethodName, "hash") == 0)
+ if (strcmp(accessMethodName, "hash") == 0 &&
+ RelationNeedsWAL(rel))
ereport(WARNING,
(errmsg("hash indexes are not WAL-logged and their use is discouraged")));