aboutsummaryrefslogtreecommitdiff
path: root/src/backend/main/main.c
diff options
context:
space:
mode:
authorMagnus Hagander <magnus@hagander.net>2010-12-19 16:45:28 +0100
committerMagnus Hagander <magnus@hagander.net>2010-12-19 16:45:28 +0100
commitdcb09b595f88a3bca6097a6acc17bf2ec935d55f (patch)
tree001eb0187a2f0d7deec867ea27c0dea6d110ff0d /src/backend/main/main.c
parent7e95337d586185c91f8af3fbcb0a6b380b4ba1c7 (diff)
downloadpostgresql-dcb09b595f88a3bca6097a6acc17bf2ec935d55f.tar.gz
postgresql-dcb09b595f88a3bca6097a6acc17bf2ec935d55f.zip
Support for collecting crash dumps on Windows
Add support for collecting "minidump" style crash dumps on Windows, by setting up an exception handling filter. Crash dumps will be generated in PGDATA/crashdumps if the directory is created (the existance of the directory is used as on/off switch for the generation of the dumps). Craig Ringer and Magnus Hagander
Diffstat (limited to 'src/backend/main/main.c')
-rw-r--r--src/backend/main/main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/backend/main/main.c b/src/backend/main/main.c
index cad78d6d665..6065e8c661c 100644
--- a/src/backend/main/main.c
+++ b/src/backend/main/main.c
@@ -82,6 +82,14 @@ main(int argc, char *argv[])
argv = save_ps_display_args(argc, argv);
/*
+ * If supported on the current platform, set up a handler to be called if
+ * the backend/postmaster crashes with a fatal signal or exception.
+ */
+#ifdef WIN32
+ pgwin32_install_crashdump_handler();
+#endif
+
+ /*
* Set up locale information from environment. Note that LC_CTYPE and
* LC_COLLATE will be overridden later from pg_control if we are in an
* already-initialized database. We set them here so that they will be