0

I have a C# program that is scheduled to run daily. The program pulls more than 10,000 rows of data form Postgres SQL server. It was working fine for about 4 weeks but suddenly it stopped working with the exception

53100: could not resize shared memory segment "/PostgreSQL.883048933" to 134217728 bytes: No space left on device

Small modification in Query fixed the error but after some days I have to change the date range from 80 to 30 days and the strange think is that I does not work for 30 days but does work for 80 days of data which is obviously less that 80 days of data.

The same query also work fine when using DB Visualizer with any date range or any kind of join condition.

I googled it up and found the following solution

pq: could not resize shared memory segment. No space left on device

which clearly says issue with the restricted shared memory size by the docker container. I am not sure if the DB server is hosted in a docker container or not. The database server is a Third party server which I don't have control of.

My question is, Is the issue at our end or at the Database end if the issue at database end why does it work in Db Visualizer but not using C# program. I am using Ado.net Data Reader and NpgSql.dll to read the data from the database server.

Muhammad Ali
  • 288
  • 3
  • 12
  • Can you add the code of your program that gets the data from Postgres SQL server and also the query (*and its modifications*)? - it's difficult to suggest workarounds without checking actual code... – Marco Aurelio Fernandez Reyes Apr 20 '22 at 22:31
  • A simple workaround would be to disable parallel query by setting `max_parallel_workers_per_gather` to 0. – Laurenz Albe Apr 21 '22 at 13:17

0 Answers0