diff options
author | Tom Lane | 2007-09-11 16:17:46 +0000 |
---|---|---|
committer | Tom Lane | 2007-09-11 16:17:46 +0000 |
commit | 125603f4bd009dba5348be4b976cd7a13c7da294 (patch) | |
tree | 839c85c5437ce009266433c47879e644af94433f | |
parent | ca6b839239eba778f63c8e65bcd5e3e32cef42be (diff) |
Include hash table name in all the internal-error elog messages in
dynahash.c. Sergey Koposov's current open problem shows the possible
usefulness of this, and it doesn't add much code.
-rw-r--r-- | src/backend/utils/hash/dynahash.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/backend/utils/hash/dynahash.c b/src/backend/utils/hash/dynahash.c index 5e0546cf9b..a72e0ed079 100644 --- a/src/backend/utils/hash/dynahash.c +++ b/src/backend/utils/hash/dynahash.c @@ -416,7 +416,7 @@ hash_create(const char *tabname, long nelem, HASHCTL *info, int flags) /* Build the hash directory structure */ if (!init_htab(hashp, nelem)) - elog(ERROR, "failed to initialize hash table"); + elog(ERROR, "failed to initialize hash table \"%s\"", hashp->tabname); /* * For a shared hash table, preallocate the requested number of elements. @@ -909,7 +909,8 @@ hash_search_with_hash_value(HTAB *hashp, /* disallow inserts if frozen */ if (hashp->frozen) - elog(ERROR, "cannot insert into a frozen hashtable"); + elog(ERROR, "cannot insert into frozen hashtable \"%s\"", + hashp->tabname); currBucket = get_hash_entry(hashp); if (currBucket == NULL) @@ -1154,9 +1155,10 @@ void hash_freeze(HTAB *hashp) { if (hashp->isshared) - elog(ERROR, "cannot freeze shared hashtable"); + elog(ERROR, "cannot freeze shared hashtable \"%s\"", hashp->tabname); if (!hashp->frozen && has_seq_scans(hashp)) - elog(ERROR, "cannot freeze hashtable with active scans"); + elog(ERROR, "cannot freeze hashtable \"%s\" because it has active scans", + hashp->tabname); hashp->frozen = true; } @@ -1432,7 +1434,8 @@ static void register_seq_scan(HTAB *hashp) { if (num_seq_scans >= MAX_SEQ_SCANS) - elog(ERROR, "too many active hash_seq_search scans"); + elog(ERROR, "too many active hash_seq_search scans, cannot start one on \"%s\"", + hashp->tabname); seq_scan_tables[num_seq_scans] = hashp; seq_scan_level[num_seq_scans] = GetCurrentTransactionNestLevel(); num_seq_scans++; |