>> His code NEVER exited the WHILE statement so he kept on beginning over
>> and over again... After about 3-4 hours, postgreSQL would just go away.
>> I enabled some extended logging and restarted the data server....
Now that I think about it, 4 billion consecutive BEGINs (or a BEGIN
followed by 4 billion commands of any kind) would eventually hit the
CommandCounter wraparound limit. This doesn't cause a crash though.
This is what it looks like in 7.2:
regression=# begin;
NOTICE: BEGIN: already a transaction in progress
BEGIN
regression=# begin;
NOTICE: BEGIN: already a transaction in progress
ERROR: You may only have 2^32-1 commands per transaction
regression=# begin;
NOTICE: current transaction is aborted, queries ignored until end of transaction block
*ABORT STATE*
regression=# begin;
NOTICE: current transaction is aborted, queries ignored until end of transaction block
*ABORT STATE*
regression=# begin;
(No, I didn't really execute 4 billion begins, just twiddled the counter
with a debugger ...)
But Greg still hasn't told us exactly what undesirable behavior he's
seeing.
regards, tom lane