Create schema with in a specific database from a script file

Поиск
Список
Период
Сортировка
От Abhra Kar
Тема Create schema with in a specific database from a script file
Дата
Msg-id CAFNULEcrj_+ncsxYT6J=N75ijsYd0sO2YB=_6vXjJBBTt9D=OA@mail.gmail.com
обсуждение исходный текст
Ответы Re: Create schema with in a specific database from a script file  (Melvin Davidson <melvin6925@gmail.com>)
Create schema with in a specific database from a script file  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general

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

su -c "psql -c \"create schema authorization myschema\"" postgres

 

In the terminal got message “connected to ABC database”. But schema created with in postgres database not with in ABC database.

What should be the proper script ?

 

Thanks and Regards,

Abhra

В списке pgsql-general по дате отправления:

Предыдущее
От: Geoffrey Hoffman
Дата:
Сообщение: Ensure extension exists
Следующее
От: Melvin Davidson
Дата:
Сообщение: Re: Create schema with in a specific database from a script file