jfischoff / tmp-postgres

Create temporary postgres instances
BSD 3-Clause "New" or "Revised" License
53 stars 18 forks source link

How to change the generated user? #261

Closed kozross closed 4 years ago

kozross commented 4 years ago

The user that gets generated is always the same as the UNIX user. This isn't terribly portable, and I'm unsure how to change it.

jfischoff commented 4 years ago

You have to customize the parameters to initdb. The helper optionsToDefaultConfig is the easiest way.

The test here has an example: https://github.com/jfischoff/tmp-postgres/blob/master/test/Main.hs#L169

Although I'm sure how clear that example is. You make a Config with optionsToDefaultConfig and then use it with withConfig.