File tree 3 files changed +9
-1
lines changed
3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -490,7 +490,8 @@ DefineIndex(Oid relationId,
490
490
accessMethodId = HeapTupleGetOid (tuple );
491
491
accessMethodForm = (Form_pg_am ) GETSTRUCT (tuple );
492
492
493
- if (strcmp (accessMethodName , "hash" ) == 0 )
493
+ if (strcmp (accessMethodName , "hash" ) == 0 &&
494
+ RelationNeedsWAL (rel ))
494
495
ereport (WARNING ,
495
496
(errmsg ("hash indexes are not WAL-logged and their use is discouraged" )));
496
497
Original file line number Diff line number Diff line change @@ -2342,6 +2342,9 @@ CREATE INDEX hash_txt_index ON hash_txt_heap USING hash (random text_ops);
2342
2342
WARNING: hash indexes are not WAL-logged and their use is discouraged
2343
2343
CREATE INDEX hash_f8_index ON hash_f8_heap USING hash (random float8_ops);
2344
2344
WARNING: hash indexes are not WAL-logged and their use is discouraged
2345
+ CREATE UNLOGGED TABLE unlogged_hash_table (id int4);
2346
+ CREATE INDEX unlogged_hash_index ON unlogged_hash_table USING hash (id int4_ops);
2347
+ DROP TABLE unlogged_hash_table;
2345
2348
-- CREATE INDEX hash_ovfl_index ON hash_ovfl_heap USING hash (x int4_ops);
2346
2349
--
2347
2350
-- Test functional index
Original file line number Diff line number Diff line change @@ -684,6 +684,10 @@ CREATE INDEX hash_txt_index ON hash_txt_heap USING hash (random text_ops);
684
684
685
685
CREATE INDEX hash_f8_index ON hash_f8_heap USING hash (random float8_ops);
686
686
687
+ CREATE UNLOGGED TABLE unlogged_hash_table (id int4);
688
+ CREATE INDEX unlogged_hash_index ON unlogged_hash_table USING hash (id int4_ops);
689
+ DROP TABLE unlogged_hash_table;
690
+
687
691
-- CREATE INDEX hash_ovfl_index ON hash_ovfl_heap USING hash (x int4_ops);
688
692
689
693
You can’t perform that action at this time.
0 commit comments