I just encountered the exact same problem today.
Here's what I have :
OpenACS 5.1.1
Aolserver 4.0.7
Postgresql 7.4.3
This is my first time working with postgresql install compiled from source. I have always worked with RPMs until today.
I am going to try to use Postgresql 7.4.1 and see if that solves my problems.
What version of AOLServer are you guys using ?