Caused By Org.postgresql.util.psqlexception Error Out Of Shared Memory
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings
Postgres Max_locks_per_transaction
and policies of this site About Us Learn more about Stack Overflow postgres out of shared memory the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation
How To Change Max_locks_per_transaction
Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it postgres shared memory only takes a minute: Sign up ERROR: out of shared memory up vote 0 down vote favorite I have a query that inserts a given number of test records. It looks something like this: CREATE OR REPLACE FUNCTION _miscRandomizer(vNumberOfRecords int) RETURNS void AS $$ declare -- declare all the variables that will be used begin select into vTotalRecords count(*) from postgresql out of memory tbluser; vIndexMain := vTotalRecords; loop exit when vIndexMain >= vNumberOfRecords + vTotalRecords; -- set some other variables that will be used for the insert -- insert record with these variables in tblUser -- insert records in some other tables -- run another function that calculates and saves some stats regarding inserted records vIndexMain := vIndexMain + 1; end loop; return; end $$ LANGUAGE plpgsql; When I run this query for 300 records it throws the following error: ********** Error ********** ERROR: out of shared memory SQL state: 53200 Hint: You might need to increase max_locks_per_transaction. Context: SQL statement "create temp table _counts(...)" PL/pgSQL function prcStatsUpdate(integer) line 25 at SQL statement SQL statement "SELECT prcStatsUpdate(vUserId)" PL/pgSQL function _miscrandomizer(integer) line 164 at PERFORM The function prcStatsUpdate looks like this: CREATE OR REPLACE FUNCTION prcStatsUpdate(vUserId int) RETURNS void AS $$ declare vRequireCount boolean; vRecordsExist boolean; begin -- determine if this stats calculation needs to be performed select into vRequireCount case when count(*) > 0 then true else false end from tblSomeTable q where [x = y] and [x = y];
pgsql-announce pgsql-bugs pgsql-docs pgsql-general pgsql-interfaces pgsql-jobs pgsql-novice pgsql-performance pgsql-php pgsql-sql pgsql-students Developer lists Regional lists Associations User groups Project lists Inactive lists IRC Local User Groups Featured Users International Sites Propaganda Resources Weekly News ERROR: out of shared memory From: "Sorin N(dot) Ciolofan"
Reply | Threaded Open this post in threaded view ♦ ♦ | Report Content as Inappropriate ♦ ♦ ERROR: out of shared memory Hello! I have to manage an application http://postgresql.nabble.com/ERROR-out-of-shared-memory-td1878803.html written in java which call another module written in java which uses Postgre DBMS in a Linux environment. I'm new to Postgres. The problem is that for large amounts of data the application throws an: org.postgresql.util.PSQLException: ERROR: out of shared memory Please, have you any idea why this error appears and what can I do in order to fix this? Are there some Postgre related parameters I should tune out of (if yes what parameters) or is something related to the Linux OS? Thank you very much With best regards, Sorin Tom Lane-2 Reply | Threaded Open this post in threaded view ♦ ♦ | Report Content as Inappropriate ♦ ♦ Re: ERROR: out of shared memory "Sorin N. Ciolofan" <[hidden email]> writes: > I have to manage an application written in java which call another module > out of shared written in java which uses Postgre DBMS in a Linux environment. I'm new to > Postgres. The problem is that for large amounts of data the application > throws an: > org.postgresql.util.PSQLException: ERROR: out of shared memory AFAIK the only very likely way to cause that is to touch enough different tables in one transaction that you run out of lock entries. While you could postpone the problem by increasing the max_locks_per_transaction setting, I suspect there may be some basic application misdesign involved here. How many tables have you got? regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend Merlin Moncure-2 Reply | Threaded Open this post in threaded view ♦ ♦ | Report Content as Inappropriate ♦ ♦ Re: ERROR: out of shared memory On 3/26/07, Tom Lane <[hidden email]> wrote: > "Sorin N. Ciolofan" <[hidden email]> writes: > > I have to manage an application written in java which call another module > > written in java which uses Postgre DBMS in a Linux environment. I'm new to > > Postgres. The problem is that for large amounts of data the application > > throws an: > > org.postgresql.util.PSQLE