Create schema with in a specific database from a script file

2018-02-01 Thread David G. Johnston
On Thursday, February 1, 2018, Abhra Kar wrote: > > In xyz.sh I executed the following script --- > > *su -c "psql -c \"\c ABC \"" postgres* > > *su -c "psql -c \"create schema authorization myschema\"" postgres* > > > > In the terminal got message “connected to ABC database”. But schema > c

Re: Create schema with in a specific database from a script file

2018-02-01 Thread Melvin Davidson
On Thu, Feb 1, 2018 at 9:42 PM, Abhra Kar wrote: > *sudo **-u** postgres createdb ABC* > > *su **-c* *"**psql -d ABC**"* > > *if [* *$3* *==* *'x'* *]* > > *then* > > *su **-c* *"**psql -c **\"**grant all privileges on database ABC** to > **\"**"** postgres* > > *su **-c* *"**psql -c **\"

Re: Create schema with in a specific database from a script file

2018-02-01 Thread Abhra Kar
*sudo **-u** postgres createdb ABC* *su **-c* *"**psql -d ABC**"* *if [* *$3* *==* *'x'* *]* *then* *su **-c* *"**psql -c **\"**grant all privileges on database ABC** to * *\"**"** postgres* *su **-c* *"**psql -c **\"**create schema authorization **\"**"** postgres* *else* *su **

Re: Create schema with in a specific database from a script file

2018-02-01 Thread Melvin Davidson
On Thu, Feb 1, 2018 at 9:09 PM, Abhra Kar wrote: > Hi, > >I have to write script for psql in a xyz.sh file which should create a > schema in a specific data.In psql prompt I achieve it like -- > > > postgres=# \c ABC > > ABC=# create schema authorization myschema > > > > In xyz.sh I exec

Create schema with in a specific database from a script file

2018-02-01 Thread Abhra Kar
Hi, I have to write script for psql in a xyz.sh file which should create a schema in a specific data.In psql prompt I achieve it like -- postgres=# \c ABC ABC=# create schema authorization myschema In xyz.sh I executed the following script --- *su -c "psql -c \"\c ABC \"" postgres*