We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent5b26278 commit84aa8baCopy full SHA for 84aa8ba
src/backend/commands/indexcmds.c
@@ -489,6 +489,10 @@ DefineIndex(Oid relationId,
489
accessMethodId=HeapTupleGetOid(tuple);
490
accessMethodForm= (Form_pg_am)GETSTRUCT(tuple);
491
492
+if (strcmp(accessMethodName,"hash")==0)
493
+ereport(WARNING,
494
+(errmsg("hash indexes are not WAL-logged so they are not crash-safe and cannot be used on streaming standbys")));
495
+
496
if (stmt->unique&& !accessMethodForm->amcanunique)
497
ereport(ERROR,
498
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
src/test/regress/expected/create_index.out
@@ -2238,9 +2238,13 @@ DROP TABLE array_gin_test;
2238
-- HASH
2239
--
2240
CREATE INDEX hash_i4_index ON hash_i4_heap USING hash (random int4_ops);
2241
+WARNING: hash indexes are not WAL-logged so they are not crash-safe and cannot be used on streaming standbys
2242
CREATE INDEX hash_name_index ON hash_name_heap USING hash (random name_ops);
2243
2244
CREATE INDEX hash_txt_index ON hash_txt_heap USING hash (random text_ops);
2245
2246
CREATE INDEX hash_f8_index ON hash_f8_heap USING hash (random float8_ops);
2247
2248
-- CREATE INDEX hash_ovfl_index ON hash_ovfl_heap USING hash (x int4_ops);
2249
2250
-- Test functional index
src/test/regress/expected/enum.out
@@ -383,6 +383,7 @@ DROP INDEX enumtest_btree;
383
-- Hash index / opclass with the = operator
384
385
CREATE INDEX enumtest_hash ON enumtest USING hash (col);
386
387
SELECT * FROM enumtest WHERE col = 'orange';
388
col
389
--------
src/test/regress/expected/macaddr.out
@@ -39,6 +39,7 @@ SELECT * FROM macaddr_data;
39
40
CREATE INDEX macaddr_data_btree ON macaddr_data USING btree (b);
41
CREATE INDEX macaddr_data_hash ON macaddr_data USING hash (b);
42
43
SELECT a, b, trunc(b) FROM macaddr_data ORDER BY 2, 1;
44
a | b | trunc
45
----+-------------------+-------------------
src/test/regress/expected/replica_identity.out
@@ -11,6 +11,7 @@ CREATE INDEX test_replica_identity_keyab ON test_replica_identity (keya, keyb);
11
CREATE UNIQUE INDEX test_replica_identity_keyab_key ON test_replica_identity (keya, keyb);
12
CREATE UNIQUE INDEX test_replica_identity_nonkey ON test_replica_identity (keya, nonkey);
13
CREATE INDEX test_replica_identity_hash ON test_replica_identity USING hash (nonkey);
14
15
CREATE UNIQUE INDEX test_replica_identity_expr ON test_replica_identity (keya, keyb, (3));
16
CREATE UNIQUE INDEX test_replica_identity_partial ON test_replica_identity (keya, keyb) WHERE keyb != '3';
17
-- default is 'd'/DEFAULT for user created tables
src/test/regress/expected/uuid.out
@@ -114,6 +114,7 @@ SELECT COUNT(*) FROM guid1 WHERE guid_field >= '22222222-2222-2222-2222-22222222
114
-- btree and hash index creation test
115
CREATE INDEX guid1_btree ON guid1 USING BTREE (guid_field);
116
CREATE INDEX guid1_hash ON guid1 USING HASH (guid_field);
117
118
-- unique index test
119
CREATE UNIQUE INDEX guid1_unique_BTREE ON guid1 USING BTREE (guid_field);
120
-- should fail