Re: How to run a script with Query Tool?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: How to run a script with Query Tool?
Дата
Msg-id 1666403.1592582989@sss.pgh.pa.us
обсуждение исходный текст
Ответ на How to run a script with Query Tool?  (Richard Bernstein <richb201@gmail.com>)
Ответы Re: How to run a script with Query Tool?  (Richard Bernstein <richb201@gmail.com>)
Список pgsql-novice
Richard Bernstein <richb201@gmail.com> writes:
> I have a script that I need to run. The SQL script first creates a database
> called sampledb.
> CREATE DATABASE `sampledb`
> I read in the docs that to start the Query Tool I need to pick Query Tool
> from the Tools menu. But the Query Tool is greyed out unless I have already
> chosen a database. I am concerned about running the script (which creates a
> database) since I am already in a database. Seems illogical. Can someone
> confirm that I can run my script in any of the existing databases with
> causing a major issue for myself?

You *must* connect to some existing database in the cluster to issue
CREATE DATABASE.  Doesn't matter which one.

The more interesting question is that your script probably then wishes to
reconnect to the new database so it can do things there.  I'm not sure how
you'd do that in pgadmin (which I assume is what you're talking about).
You might want to ask that question on a pgadmin-specific list, which this
isn't.

            regards, tom lane



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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: How to run a script with Query Tool?
Следующее
От: Richard Bernstein
Дата:
Сообщение: Re: How to run a script with Query Tool?