Postgresql Error Out Of Shared Memory
Contents |
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 Re: Out increase max_locks_per_transaction postgresql of Shared Memory: max_locks_per_transaction From: Merlin Moncure
Org.postgresql.util.psqlexception: Error: Out Of Shared Memory
Nov 9, 2012 at 8:43 AM, Eliot Gable
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 postgres shared memory configuration Propaganda Resources Weekly News Re: Out of Shared Memory: max_locks_per_transaction From: Eliot
Pg_dump: Warning: Out Of Shared Memory
Gable
Postgresql Out Of Memory
CAD-6L_WdFxsN7NYddqkwvTnYDfxLq1CSY4JKMQPrWYMxu8idvQ@mail.gmail.com (view raw or whole thread) Thread: 2012-11-09 14:43:17 from Eliot Gable
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business http://stackoverflow.com/questions/16490664/error-out-of-shared-memory Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it 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. out of 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 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 out of shared 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]; -- if above is true, determine if stats were previously calculated select into vRecordsExist case when count(*) > 0 then true else false end from tblSomeOtherTable c inner join tblSomeTable q on q.Id = c.Id where [x = y] and [x = y] and [x = y] and vRequireCount = true; -- calculate counts and store them in temp table create temp table _counts(...); insert into _counts(x, y, z) select uqa.x, uqa.y, count(*) as aCount from tblSomeOtherTable uqa inner join tblSomeTable q on uqa.Id = q.Id where uqa.Id = vU