[HACKERS] an outdated comment for hash_seq_init. - Mailing list pgsql-hackers

From Kyotaro HORIGUCHI
Subject [HACKERS] an outdated comment for hash_seq_init.
Date
Msg-id 20170424.165541.230634914.horiguchi.kyotaro@lab.ntt.co.jp
Whole thread Raw
Responses Re: [HACKERS] an outdated comment for hash_seq_init.  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Hello.

While I looked into dynahash.c, I found that the following
sentense became outdated by 5dfc198. The commit removed the only
usage of hash_freeze().

> * NOTE: it is possible to use hash_seq_init/hash_seq_search without any
> * worry about hash_seq_term cleanup, if the hashtable is first locked against
> * further insertions by calling hash_freeze.  This is used by nodeAgg.c,
> * wherein it is inconvenient to track whether a scan is still open, and
> * there's no possibility of further insertions after readout has begun.

The attached patch removes the sentence begins with "This is used
by..".

regards,

-- 
Kyotaro Horiguchi
NTT Open Source Software Center
diff --git a/src/backend/utils/hash/dynahash.c b/src/backend/utils/hash/dynahash.c
index 12b1658..1adc5841 100644
--- a/src/backend/utils/hash/dynahash.c
+++ b/src/backend/utils/hash/dynahash.c
@@ -1330,9 +1330,7 @@ hash_get_num_entries(HTAB *hashp) * * NOTE: it is possible to use hash_seq_init/hash_seq_search
withoutany * worry about hash_seq_term cleanup, if the hashtable is first locked against
 
- * further insertions by calling hash_freeze.  This is used by nodeAgg.c,
- * wherein it is inconvenient to track whether a scan is still open, and
- * there's no possibility of further insertions after readout has begun.
+ * further insertions by calling hash_freeze. * * NOTE: to use this with a partitioned hashtable, caller had better
hold* at least shared lock on all partitions of the table throughout the scan! 

pgsql-hackers by date:

Previous
From: "Ideriha, Takeshi"
Date:
Subject: Re: [HACKERS] visual studio 2017 build support
Next
From: Konstantin Knizhnik
Date:
Subject: [HACKERS] Cached plans and statement generalization