File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -490,7 +490,8 @@ DefineIndex(Oid relationId,
490490 accessMethodId = HeapTupleGetOid (tuple );
491491 accessMethodForm = (Form_pg_am ) GETSTRUCT (tuple );
492492
493- if (strcmp (accessMethodName , "hash" ) == 0 )
493+ if (strcmp (accessMethodName , "hash" ) == 0 &&
494+ RelationNeedsWAL (rel ))
494495 ereport (WARNING ,
495496 (errmsg ("hash indexes are not WAL-logged and their use is discouraged" )));
496497
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);
23422342WARNING: hash indexes are not WAL-logged and their use is discouraged
23432343CREATE INDEX hash_f8_index ON hash_f8_heap USING hash (random float8_ops);
23442344WARNING: 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;
23452348-- CREATE INDEX hash_ovfl_index ON hash_ovfl_heap USING hash (x int4_ops);
23462349--
23472350-- 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);
684684
685685CREATE INDEX hash_f8_index ON hash_f8_heap USING hash (random float8_ops);
686686
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+
687691-- CREATE INDEX hash_ovfl_index ON hash_ovfl_heap USING hash (x int4_ops);
688692
689693
You can’t perform that action at this time.
0 commit comments