Thread: newbie Connect question

newbie Connect question

From
"Phil Oelkers"
Date:
I'm trying to run the following script through interactive postgres.

CONNECT DATABASE BASEBALL;

CREATE UNIQUE index1 on team(team_name);

If I start postgres as

>psql baseball

the script runs no problem.  If I start it as

>pgsql template1 (or any other database) I get a
cann't connect to database error.  So my question is
how do I connect to more than one database at a time?




Re: [GENERAL] newbie Connect question

From
Jim Richards
Date:
At 05:07  1/09/99 -0500, Phil Oelkers wrote:
>I'm trying to run the following script through interactive postgres.
>
>CONNECT DATABASE BASEBALL;

The correct way to connect to another database within psql is

\connect baseball

but you need to be careful then which user you are attched to. Unlike
Oracle, all users can do DML (CREATE, etc) across all databases, unless
you have specifically set up your security, which is something I'm trying
to work out ...


----
CyberCyberCyberCyber Pty Ltd
 http://www.cyber4.org/cyber4/index.html
  New Media For The New Millennium