public inbox for [email protected]
help / color / mirror / Atom feedFrom: Tom Lane <[email protected]>
To: Richard Bernstein <[email protected]>
Cc: [email protected]
Subject: Re: How to run a script with Query Tool?
Date: Fri, 19 Jun 2020 12:09:49 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAKXm1c1TRgjcTeyM1sJzqt2L_Lp+7-v86S0YoVwX-95WwVas-Q@mail.gmail.com>
References: <CAKXm1c1TRgjcTeyM1sJzqt2L_Lp+7-v86S0YoVwX-95WwVas-Q@mail.gmail.com>
Richard Bernstein <[email protected]> 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
view thread (4+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: How to run a script with Query Tool?
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox