Skip to content

Commit 2959213

Browse files
committed
pg_stat_statements: Add a comment about the dangers of padding bytes.
Inspired by a patch from Julien Rouhaud, but I reworded it. Discussion: http://postgr.es/m/CAOBaU_a8AH8=ypfqgHnDYu06ts+jWTUgh=VgCxA3yNV-K10j9w@mail.gmail.com
1 parent e250c8c commit 2959213

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

contrib/pg_stat_statements/pg_stat_statements.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,11 @@ typedef enum pgssVersion
125125
/*
126126
* Hashtable key that defines the identity of a hashtable entry. We separate
127127
* queries by user and by database even if they are otherwise identical.
128+
*
129+
* Right now, this structure contains no padding. If you add any, make sure
130+
* to teach pgss_store() to zero the padding bytes. Otherwise, things will
131+
* break, because pgss_hash is created using HASH_BLOBS, and thus tag_hash
132+
* is used to hash this.
128133
*/
129134
typedef struct pgssHashKey
130135
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy