pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Equivalent shell script of create user and schema in specific postgres db
2+ messages / 2 participants
[nested] [flat]

* Equivalent shell script of create user and schema in specific postgres db
@ 2018-01-31 16:57 Abhra Kar <abhra.kar@gmail.com>
  2018-01-31 17:13 ` Re: Equivalent shell script of create user and schema in specific postgres db Karsten Hilbert <Karsten.Hilbert@gmx.net>
  0 siblings, 1 reply; 2+ messages in thread

From: Abhra Kar @ 2018-01-31 16:57 UTC (permalink / raw)
  To: pgsql-general

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?

Thanks

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Equivalent shell script of create user and schema in specific postgres db
  2018-01-31 16:57 Equivalent shell script of create user and schema in specific postgres db Abhra Kar <abhra.kar@gmail.com>
@ 2018-01-31 17:13 ` Karsten Hilbert <Karsten.Hilbert@gmx.net>
  0 siblings, 0 replies; 2+ messages in thread

From: Karsten Hilbert @ 2018-01-31 17:13 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org; 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




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2018-01-31 17:13 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-01-31 16:57 Equivalent shell script of create user and schema in specific postgres db Abhra Kar <abhra.kar@gmail.com>
2018-01-31 17:13 ` Karsten Hilbert <Karsten.Hilbert@gmx.net>

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