aboutsummaryrefslogtreecommitdiff
path: root/src/include/utils/ascii.h
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2011-10-21 13:26:40 -0400
committerRobert Haas <rhaas@postgresql.org>2011-10-21 13:26:40 -0400
commitc8e8b5a6e20bf471d83059aebe64bca16f184057 (patch)
tree2c346104aa4579489126b5eceee07080aafda017 /src/include/utils/ascii.h
parent980261929f2b8c40d6be1979ff81c943cad907b3 (diff)
downloadpostgresql-c8e8b5a6e20bf471d83059aebe64bca16f184057.tar.gz
postgresql-c8e8b5a6e20bf471d83059aebe64bca16f184057.zip
Try to log current the query string when a backend crashes.
To avoid minimize risk inside the postmaster, we subject this feature to a number of significant limitations. We very much wish to avoid doing any complex processing inside the postmaster, due to the posssibility that the crashed backend has completely corrupted shared memory. To that end, no encoding conversion is done; instead, we just replace anything that doesn't look like an ASCII character with a question mark. We limit the amount of data copied to 1024 characters, and carefully sanity check the source of that data. While these restrictions would doubtless be unacceptable in a general-purpose logging facility, even this limited facility seems like an improvement over the status quo ante. Marti Raudsepp, reviewed by PDXPUG and myself
Diffstat (limited to 'src/include/utils/ascii.h')
-rw-r--r--src/include/utils/ascii.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/include/utils/ascii.h b/src/include/utils/ascii.h
index ad70e037bd7..adeddb5626f 100644
--- a/src/include/utils/ascii.h
+++ b/src/include/utils/ascii.h
@@ -16,5 +16,6 @@
extern Datum to_ascii_encname(PG_FUNCTION_ARGS);
extern Datum to_ascii_enc(PG_FUNCTION_ARGS);
extern Datum to_ascii_default(PG_FUNCTION_ARGS);
+extern void ascii_safe_strncpy(char *dest, const char *src, int len);
#endif /* _ASCII_H_ */