If you are getting the error "Error from postgres wrapper: PostgreSQL has not been configured by the administrator" when trying to create a user or a database via cpanel,

You can do the below steps to fix this

1) removed postgresql packages from the server
2) /scripts/installpostgres
3) Login to WHM >> SQL Services >> Postgres Config >> Click on “Install Config”.
4) /scrips/makecpphp