1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-22 02:52:08 +03:00

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
This commit is contained in:
Robert Haas
2015-06-26 11:37:32 -04:00
parent 91118f1a59
commit 9043ef390f
3 changed files with 9 additions and 1 deletions

View File

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