pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Karsten Hilbert <Karsten.Hilbert@gmx.net>
To: pgsql-general@lists.postgresql.org
To: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: Equivalent shell script of create user and schema in specific postgres db
Date: Wed, 31 Jan 2018 18:13:40 +0100
Message-ID: <20180131171340.GB1998@hermes.hilbert.loc> (raw)
In-Reply-To: <CAFNULEeqmQxctPpUknOjdDMY8a+rEexRHauz5_1vsab9sbvZPA@mail.gmail.com>
References: <CAFNULEeqmQxctPpUknOjdDMY8a+rEexRHauz5_1vsab9sbvZPA@mail.gmail.com>

On Wed, Jan 31, 2018 at 10:27:53PM +0530, Abhra Kar wrote:

> Create a user and schema of same name with in ‘abc’ db through linux shell –
> 
> 
> 
> Psql steps---
> 
> 
> 
> 1>  [/home]# su postgres
> 
> 2>  bash-4.1$ psql
> 
> 3>  postgres=# \c abc  [ set database abc]
> 
> 4>  abc=# create user abhra with password ‘1234’
> 
> 5>  abc=# alter user abhra  with superuser
> 
> 6>  abc=# create schema authorization with abhra;
> 
> 
> I need to create a xyz.sh file which will do the same thing and username
> and password pass as argument. Like in a configuration file it will be
> mentioned and in xyz.sh file will be access as $1 , $2
> 
> 
> What should be the equivalent shell script?

This rather sounds like a homework assignment.

What have you tried so far ?

Regards,
Karsten
-- 
GPG key ID E4071346 @ eu.pool.sks-keyservers.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346




view thread (2+ messages)

Message-ID: <20180131171340.GB1998@hermes.hilbert.loc>
Permalink:  ../20180131171340.GB1998@hermes.hilbert.loc/
Also on:    postgresql.org/message-id/20180131171340.GB1998@hermes.hilbert.loc

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: Karsten.Hilbert@gmx.net
  Subject: Re: Equivalent shell script of create user and schema in specific postgres db
  In-Reply-To: <20180131171340.GB1998@hermes.hilbert.loc>
  References: <CAFNULEeqmQxctPpUknOjdDMY8a+rEexRHauz5_1vsab9sbvZPA@mail.gmail.com> <20180131171340.GB1998@hermes.hilbert.loc>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox