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

Issue a warning during the creation of hash indexes

This commit is contained in:
Bruce Momjian
2014-09-10 16:54:40 -04:00
parent 5b26278822
commit 84aa8ba128
6 changed files with 12 additions and 0 deletions

View File

@ -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),