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

Поиск
Список
Период
Сортировка
От Melvin Davidson
Тема Re: Create schema with in a specific database from a script file
Дата
Msg-id CANu8FixPyhyo1S-qR8bD84tQ5YVGXcjw4jMQYtfHCQVRd-vNBQ@mail.gmail.com
обсуждение исходный текст
Ответ на Create schema with in a specific database from a script file  (Abhra Kar <abhra.kar@gmail.com>)
Ответы Re: Create schema with in a specific database from a script file  (Abhra Kar <abhra.kar@gmail.com>)
Список pgsql-general


On Thu, Feb 1, 2018 at 9:09 PM, Abhra Kar <abhra.kar@gmail.com> 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 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


> But schema created with in postgres database not with in ABC database.
Just specify the database in the command line:
EG: su -c "psql -d ABC"



--
Melvin Davidson
I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.

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

Предыдущее
От: Abhra Kar
Дата:
Сообщение: Create schema with in a specific database from a script file
Следующее
От: Abhra Kar
Дата:
Сообщение: Re: Create schema with in a specific database from a script file