Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

Re: How do create a user with a bashscript


  • From: Devrim GÜNDÜZ <devrim(at)gunduz(dot)org>
  • To: A B <gentosaker(at)gmail(dot)com>
  • Cc: pgsql-novice(at)postgresql(dot)org
  • Subject: Re: How do create a user with a bashscript
  • Date: Tue, 23 Sep 2008 08:29:24 +0300
  • Message-id: <1222147764.3461.19.camel@laptop.gunduz.org> <text/plain>

On Fri, 2008-09-19 at 09:11 +0200, A B wrote:
> #!/bin/bash
> createuser  myuser
> 
> but I want to supply a password on the command line, is that possible?
> The docs tells me no, but does anyone know of a workaround?

psql mydb -c "ALTER ROLE myrole WITH ENCRYPTED PASSWORD mypass"

could work, I think.
-- 
Devrim GÜNDÜZ, RHCE
devrim~gunduz.org, devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
                   http://www.gunduz.org

Attachment: signature.asc
Description: This is a digitally signed message part



Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group