Re: Creating table in different database

Lists: pgsql-hackers
From: Paresh Bafna <paresh(at)it(dot)iitb(dot)ac(dot)in>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Creating table in different database
Date: 2005-10-24 18:02:55
Message-ID: 435D21CF.4080007@it.iitb.ac.in
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

If there are multiple databases, say db1 and db2.
And currently we are in db1, can we create table in db2 (without
switching databases)?
Is there any query to do this?

- Paresh


From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Paresh Bafna <paresh(at)it(dot)iitb(dot)ac(dot)in>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Creating table in different database
Date: 2005-10-24 20:39:36
Message-ID: 20051024203936.GA25814@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Oct 24, 2005 at 11:32:55PM +0530, Paresh Bafna wrote:
> If there are multiple databases, say db1 and db2.
> And currently we are in db1, can we create table in db2 (without
> switching databases)?
> Is there any query to do this?

This question seems off-topic for pgsql-hackers. The mailing list's
description says:

The PostgreSQL developers team lives here. Discussion of current
development issues, problems and bugs, and proposed new features.
If your question cannot be answered by people in the other lists,
and it is likely that only a developer will know the answer, you
may re-post your question in this list. You must try elsewhere
first!

You could use contrib/dblink, but perhaps you should be using schemas
instead of separate databases.

--
Michael Fuhr