aboutsummaryrefslogtreecommitdiff
path: root/contrib/pg_stat_statements/pg_stat_statements.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2017-10-20 09:40:17 -0400
committerRobert Haas <rhaas@postgresql.org>2017-10-20 09:44:03 -0400
commit2959213bf33cf7d2d1fc0b46c67d36254ffe043f (patch)
treefa27a85b14f54b3559d65c9823c359d26fe7b46a /contrib/pg_stat_statements/pg_stat_statements.c
parente250c8c8408a1c068285df210a7ceff68c421b3b (diff)
downloadpostgresql-2959213bf33cf7d2d1fc0b46c67d36254ffe043f.tar.gz
postgresql-2959213bf33cf7d2d1fc0b46c67d36254ffe043f.zip
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
Diffstat (limited to 'contrib/pg_stat_statements/pg_stat_statements.c')
-rw-r--r--contrib/pg_stat_statements/pg_stat_statements.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/contrib/pg_stat_statements/pg_stat_statements.c b/contrib/pg_stat_statements/pg_stat_statements.c
index b04b4d6ce11..3de8333be2b 100644
--- a/contrib/pg_stat_statements/pg_stat_statements.c
+++ b/contrib/pg_stat_statements/pg_stat_statements.c
@@ -125,6 +125,11 @@ typedef enum pgssVersion
/*
* Hashtable key that defines the identity of a hashtable entry. We separate
* queries by user and by database even if they are otherwise identical.
+ *
+ * Right now, this structure contains no padding. If you add any, make sure
+ * to teach pgss_store() to zero the padding bytes. Otherwise, things will
+ * break, because pgss_hash is created using HASH_BLOBS, and thus tag_hash
+ * is used to hash this.
*/
typedef struct pgssHashKey
{