# Adding user to postgres installation

**URL:** <https://discourse.chef.io/t/adding-user-to-postgres-installation/1192>\
**Category:** Chef Infra (archive)\
**Created:** [June 28, 2009, 2:20am UTC](https://discourse.chef.io/t/adding-user-to-postgres-installation/1192 "2009-06-28T02:20:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joe\_Van\_Dyk](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/joe_van_dyk/32/853_2.png) [@Joe\_Van\_Dyk](https://discourse.chef.io/u/Joe_Van_Dyk)\
**Post date:** [June 28, 2009, 2:20am UTC](https://discourse.chef.io/t/adding-user-to-postgres-installation/1192/1 "2009-06-28T02:20:37Z")

</div>

Hi,

Seems like the postgresql cookbook should create a user when the  
server is installed, or at least have some placeholder code in there  
for it.

Would running a shell command (createuser) in the recipe file be all  
that’s necessary?

Joe

---

<div class="post-metadata">

**Author:** ![Adam\_Jacob](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/adam_jacob/32/292_2.png) [@Adam\_Jacob](https://discourse.chef.io/u/Adam_Jacob)\
**Post date:** [June 28, 2009, 7:56pm UTC](https://discourse.chef.io/t/adding-user-to-postgres-installation/1192/2 "2009-06-28T19:56:33Z")

</div>

On Sat, Jun 27, 2009 at 7:20 PM, Joe Van Dyk[joe@fixieconsulting.com](mailto:joe@fixieconsulting.com) wrote:

> Hi,
> 
> Seems like the postgresql cookbook should create a user when the  
> server is installed, or at least have some placeholder code in there  
> for it.
> 
> Would running a shell command (createuser) in the recipe file be all  
> that's necessary?

Yes. I would take this a step further, and have it be driven by  
attributes. That way people could set up a role with an override to  
add more users, etc.

Adam

--  
Opscode, Inc.  
Adam Jacob, CTO  
T: (206) 508-4759 E: [adam@opscode.com](mailto:adam@opscode.com)
