Return-Path: pg_adm@postgres.berkeley.edu
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA01782; Thu, 2 Apr 92 11:41:34 -0800
Date: Thu, 2 Apr 92 11:41:34 -0800
Message-Id: <9204021941.AA01782@postgres.Berkeley.EDU>
From: munir@thumper.bellcore.com (Munir Cochinwala)
Subject: Postgres can't keep up???
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu
Cc: munir@thumper.bellcore.com


Hi,

I have a libpq program as follows:
>>>>

main (argc, argv)
int argc;
char *argv[];
{
    char *status;
    char my_buf[10000];
    FILE *fp;


    bzero(my_buf, 10000);
    fp = fopen("test.log","r");
    PQsetdb ("kasey");
    
    while ((fgets(my_buf, 9999, fp)) != NULL){

         status = PQexec (my_buf);
         printf("status of update %s\n", status);
         bzero(my_buf, 10000);
    	 PQreset ();
         sleep(2);
    }
    
    PQfinish ();
}

>>>>>

The file "test.log" consists of transactions, one per line:
Example: begin append(...) append (....) replace .. end

Note: There is no read in any transaction. All transactions consist of 
appends, deletes and replace only.

The problem is as follows:

If I eliminate "sleep(2)" then the program aborts with one of the following
messages:

>> backend not responding >>
  or 
>>
NOTICE:Apr  2 13:49:53:I have been signalled by the postmaster.

NOTICE:Apr  2 13:49:53:Some backend process has died unexpectedly and possibly

NOTICE:Apr  2 13:49:53:corrupted shared memory.  The current transaction was

NOTICE:Apr  2 13:49:53:aborted, and I am going to exit.  Please resend the

NOTICE:Apr  2 13:49:53:last query. -- The postgres backend
>>>

The last line in the above message keeps on repeating.




If I get rid of reset in the program, then the status returned by the first
transaction is CBEGIN, the status returned by the second transaction is
CEND and then the program stops without any message.


Could somebody explain the above behavior?

Thanks, 


Munir Cochinwala
 


