sam <sam.mahindrakar@gmail.com> writes:
> ERROR: cannot have more than 2^32-1 commands in a transaction
> But this error is occuring in a function that iam least expecting it
> to occur in.
If you haven't marked the function as read-only (IMMUTABLE or STABLE)
then each statement in it counts as a command. At least in pre-8.3
releases. You might find that updating to 8.3 would eliminate the
need to change your code.
regards, tom lane