Randomly getting PGRES_FATAL_ERROR while writing into PostgreSQL DB
NickName:AnswerSeeker Ask DateTime:2015-04-14T21:43:23

Randomly getting PGRES_FATAL_ERROR while writing into PostgreSQL DB

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

More about “Randomly getting PGRES_FATAL_ERROR while writing into PostgreSQL DB” related questions

Randomly getting PGRES_FATAL_ERROR while writing into PostgreSQL DB

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 troubleshoo...

Show Detail

TypeError: expected bytes, str found [while running 'Writing to DB/ParDo(_WriteToRelationalDBFn) while writing to db from using beam-nuggets

@mohaseeb I am trying below example to write data from pub\sub to postgresql.Getting below error while writing pub\sub data into postgresql. "/usr/local/lib/python3.7/site-packages/sqlalchemy/...

Show Detail

How to connect to postgresql in a multithreaded C application

I have a few threads in my application. Each has its own PGconn* connection that is individually opened with the same connection string. When a thread makes a query, it almost never returns

Show Detail

PostgreSQL: differentiating between a bad query and lost connection in C API

From what I can tell, if make a bad query or I restart the server while a connection is open, in both cases PQresultStatus() will return PGRES_FATAL_ERROR (handling the result of PQexec). I'd rathe...

Show Detail

Getting Exception while inserting data in Redshift DB

while fetching data from database It is working fine when trying to insert data in Redshift database getting exception MY POJO class : Quote.java @Entity public class Quote { @Id @GeneratedValue(

Show Detail

issue while writing into postgresql database in glue job

Hey I am trying to write data into postgresql db from glue job but getting below error IllegalArgumentException: Option 'dbtable' can not be empty. Below is my code which seems to be correct How I ...

Show Detail

Dataframe to PostgreSQL DB

I query 4hrs data from source PLC MS SQL db, process it with python and write the data to main Postgresql table. While writing to main Postgres table hourly, there is a duplicate value (previous 3 ...

Show Detail

Getting error while syncdb django.db.utils.ProgrammingError: permission denied for relation django_migrations

I have installed postgreSQL and psycopg2, then I created a db and user, I have granted all the permission for the user to the db and I have made all the changes in settings.py. But while I try to m...

Show Detail

Rails Production FATAL: database "db/production.postgresql" does not exist

I am following this tutorial from Digitalocean to set up my rails production server. However I am getting errors at cap production deploy:initial My setup consist of Ubuntu 14.04,Capistrano,Nginx ...

Show Detail

Getting error while running update query in postgresql

I am new to PostgreSQL. While running below update query I am getting below error. update useremails ue SET ue.useinstitutionid=id.InstitutionID from instdomains id where ue.email REGEXP CONCAT('...

Show Detail