Re: Equivalent shell script of create user and schema in specificpostgres db - Mailing list pgsql-general

From Karsten Hilbert
Subject Re: Equivalent shell script of create user and schema in specificpostgres db
Date
Msg-id 20180131171340.GB1998@hermes.hilbert.loc
Whole thread Raw
In response to Equivalent shell script of create user and schema in specificpostgres db  (Abhra Kar <abhra.kar@gmail.com>)
List pgsql-general
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


pgsql-general by date:

Previous
From: Abhra Kar
Date:
Subject: Equivalent shell script of create user and schema in specificpostgres db
Next
From: Stefan Blanke
Date:
Subject: Re: ERROR: invalid memory alloc request size 1073741824