I have hit a dead end with this error PGRES_FATAL_ERROR
while writing to my database(sequential writes). I see this error randomly during write operation and really hard to recreate and troubleshoot. I am using Postgres 9.2.9 on Windows Server 2003. I did increase the shared_memory to 128 MB on my VM as it has 1GB memory. However it did not make any difference. Below is how I am capturing the error message:
char* resStatus = PQresStatus(PQresultStatus(ires));
char* errMsg = PQerrorMessage(m_dbConn);
char* errorMsg = PQresultErrorMessage(ires);
When I try to log the error message, it is blank. What else I should do to prevent this error. Postgresql log posted below. My application log just shows the error "PGRES_FATAL_ERROR" (Issue time stamp from my app - 04/14 18:06:18.59)
2015-04-14 18:06:18.437 IST postgres DataExpress 5112 127.0.0.1:2031 552d09c2.13f8 3 SELECT 2015-04-14 18:06:18 IST Apr-00 0 LOG 0 duration: 0.000 ms
2015-04-14 18:06:18.453 IST postgres DataExpress 5112 127.0.0.1:2031 552d09c2.13f8 4 idle 2015-04-14 18:06:18 IST 0 LOG 0 disconnection: session time: 0:00:00.016 user=postgres database=DataExpress host=127.0.0.1 port=2031
2015-04-14 18:06:18.468 IST 2700 552d09c2.a8c 1 2015-04-14 18:06:18 IST 0 LOG 0 connection received: host=127.0.0.1 port=2032
2015-04-14 18:06:18.468 IST postgres DataExpress 2700 127.0.0.1:2032 552d09c2.a8c 2 authentication 2015-04-14 18:06:18 IST Apr-30 0 LOG 0 connection authorized: user=postgres database=DataExpress
2015-04-14 18:06:18.484 IST postgres DataExpress 2700 127.0.0.1:2032 552d09c2.a8c 3 SELECT 2015-04-14 18:06:18 IST Apr-00 0 LOG 0 duration: 0.000 ms
2015-04-14 18:06:18.484 IST postgres DataExpress 2700 127.0.0.1:2032 552d09c2.a8c 4 idle 2015-04-14 18:06:18 IST 0 LOG 0 disconnection: session time: 0:00:00.016 user=postgres database=DataExpress host=127.0.0.1 port=2032
2015-04-14 18:06:18.578 IST postgres DataExpress 3200 127.0.0.1:1955 552d09ae.c80 1160 INSERT 2015-04-14 18:05:58 IST Mar-00 0 LOG 0 duration: 141.000 ms
2015-04-14 18:06:18.593 IST postgres DataExpress 3200 127.0.0.1:1955 552d09ae.c80 1161 INSERT 2015-04-14 18:05:58 IST Mar-00 0 LOG 0 duration: 15.000 ms
2015-04-14 18:06:18.718 IST 5188 552d09c2.1444 1 2015-04-14 18:06:18 IST 0 LOG 0 connection received: host=127.0.0.1 port=2033
2015-04-14 18:06:41.765 IST postgres DataExpress 3200 127.0.0.1:1955 552d09ae.c80 1162 INSERT 2015-04-14 18:05:58 IST Mar-00 0 LOG 0 duration: 0.000 ms
2015-04-14 18:06:41.765 IST postgres DataExpress 5188 127.0.0.1:2033 552d09c2.1444 2 authentication 2015-04-14 18:06:18 IST Apr-34 0 LOG 0 connection authorized: user=postgres database=DataExpress
2015-04-14 18:06:41.781 IST postgres DataExpress 5188 127.0.0.1:2033 552d09c2.1444 3 SELECT 2015-04-14 18:06:18 IST Apr-00 0 LOG 0 duration: 0.000 ms
2015-04-14 18:06:41.781 IST postgres DataExpress 5188 127.0.0.1:2033 552d09c2.1444 4 idle 2015-04-14 18:06:18 IST 0 LOG 0 disconnection: session time: 0:00:23.156 user=postgres database=DataExpress host=127.0.0.1 port=2033
Copyright Notice:Content Author:「AnswerSeeker」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/29629018/randomly-getting-pgres-fatal-error-while-writing-into-postgresql-db