Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 34B612E009D for ; Tue, 1 Apr 2008 17:58:26 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 80495-05 for ; Tue, 1 Apr 2008 17:58:23 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from rn-out-0910.google.com (rn-out-0910.google.com [64.233.170.186]) by developer.postgresql.org (Postfix) with ESMTP id 7EDA12E009B for ; Tue, 1 Apr 2008 17:58:23 -0300 (ADT) Received: by rn-out-0910.google.com with SMTP id s46so1408513rnb.3 for ; Tue, 01 Apr 2008 13:58:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=JiyJD/FHnBcMuYUz2n95pJ9X/gHRPQYPsyUHLlo+yeM=; b=VXyaVjCPZmaY/r/n0Y/daB3Uy6po1FED9KPy8ABdczQMniQOZULFtUcatQdXQHzolZ8MkcUlACZDYqXPDT1d9s/WDRZizpDWT9unk9Chh6h4nS3KPO5/nSHFZKjVPG98Eb5Dj0MOWuoWiraqOuj9zVybmy1AmmrlpjqqYt/Azts= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=XOLRNopHHdvHHr+FWEyrmhGhOGh6M1gi/AEbPoxfUACNSdQRpn8T4TawFjQIhKyeM4VooQnQRhXmnfbswxTciOfXcabXA1plNAtqu7M02QciwsVUDS7lkZ5VWtdBxTKVS53x+VBRhV/cqrcvpL7CtEPpg5iN82nO71uOgF397zk= Received: by 10.114.169.2 with SMTP id r2mr13269408wae.118.1207083501277; Tue, 01 Apr 2008 13:58:21 -0700 (PDT) Received: by 10.114.181.19 with HTTP; Tue, 1 Apr 2008 13:58:21 -0700 (PDT) Message-ID: Date: Tue, 1 Apr 2008 16:58:21 -0400 From: "samantha mahindrakar" To: pgsql-performance@postgresql.org Subject: Too many commands in a transaction MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200804/14 X-Sequence-Number: 29507 Hi Iam getting the below error when iam running my program. ERROR: cannot have more than 2^32-1 commands in a transaction SQL state: 54000 If iam not wrong this error ocuurs when there are too many statements executing in one single transaction. But this error is occuring in a function that iam least expecting it to occur in. The function it occurs in is as follows: BEGIN resultindex := 1; -- Go through summedprobs, find where rnum falls, set resultindex FOR i IN REVERSE (array_upper(summedprobs,1)-1)..1 LOOP IF rnum >= summedprobs[i] AND rnum <= summedprobs[i+1] THEN resultindex := i; END IF; END LOOP; RETURN (dobs[resultindex]); EXCEPTION WHEN program_limit_exceeded THEN RAISE NOTICE 'Exception in GETRES'; RETURN (dobs[resultindex]); END; Is is beacuse of the REVERSE command? or because the program is executiung many select and update statements? Catching the exception isnt helping here either.Can anyone explain me why this error occurs and what i can do to resolve it? Thanks Sam