Thread: start/stop a database

start/stop a database

From
tatyana.krasnokutsky@gsa.gov
Date:
Hello,
I am new in PostgreSQL world coming from Oracle.
I have created two databases using command line as manual has suggested.
For instance I have done like the following:
createdb tanya
createdb eps
Now  I would like to stop my "tanya"  database and have "eps" database
running.
How can I do this?
-Thanks,
-Tanya



Re: start/stop a database

From
Michael Glaesemann
Date:
Hi Tanya,

On Jan 6, 2004, at 2:53 AM, tatyana.krasnokutsky@gsa.gov wrote:

> Now  I would like to stop my "tanya"  database and have "eps" database
> running.
> How can I do this?

You don't need to "stop" one database to have access to another one.
The postmaster controls access to all of the databases running in a
cluster. So you can have both "tanya" and "eps" going at the same time.

If you want to use the psql client to access a database, just specify
which database you want to connect to, e.g.,

psql tanya

That will bring you into psql connected to the "tanya" database. After
you're done with what you're doing in tanya, just quit psql using the
quit slash command

\q

And then start psql again to access the eps database, e.g.,

psql eps

Of course there are other ways to access the database (such as a PHP
script), and they can be used simultaneously. For example, you can
access eps using psql and tanya via a PHP script at the same time.

This is just the begining. Getting into all of the ways you can connect
to a PostgreSQL database cluster is more than I can do here. The
following link can give you an overview of how PostgreSQL works.

<http://www.postgresql.org/docs/current/static/tutorial-arch.html>

Does this help?

Michael Glaesemann
grzm myrealbox com


Re: start/stop a database

From
"scott.marlowe"
Date:
On Mon, 5 Jan 2004 tatyana.krasnokutsky@gsa.gov wrote:

> Hello,
> I am new in PostgreSQL world coming from Oracle.
> I have created two databases using command line as manual has suggested.
> For instance I have done like the following:
> createdb tanya
> createdb eps
> Now  I would like to stop my "tanya"  database and have "eps" database
> running.
> How can I do this?

I'm not sure I understand.  Do you want to be able to arbitrarily have one
or more databases up, while one or more are down, or do you think you HAVE
to shut down one database to start another?

If you need to have certain databases up / down, you can either use
pg_hba.conf to make them unavailable, or you can actually set up seperate
clusters on different ports and bring them up and down individually.

It's much easier to do this kinda thing via the pg_hba.conf file than it
is to do it via multiple clusters.

On the other hand, if you're thinking that one must go down for another to
come up, don't worry, you can run more than one database at a time just
fine under pgsql.