More postgres related fixes