Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I'm creating unit tests on a python application that uses digital certs on the server. Since I am not testing the connection between the server and the database, I need to setup the temporary test database to authenticate w/o a password for the CN listed in the certificate. The production server uses peer authentication, but I want to avoid having to force the unit test to run under a different username.

Long story short, is there a way to create a superuser in postgresql with no password in order to create a database, run a schema, etc.?

share|improve this question
5  
You should be able to achieve this by putting a line in pg_hba.conf that defines a trust connection for that user. That line should be before the lines defining the peer authentication in order to have a higher priority –  a_horse_with_no_name Feb 6 at 13:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.