Search Postgresql Archives

Re: Refer to another database

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 04, 2009 at 04:41:51AM +0200, Andreas Kalsch wrote:
> How is it possible to refer to another database, like:
>
> select * from otherDatabase.nodes;

Generally, you use schemas for this.  Schemas are just namespaces
inside the one database.

> I have read something about schemas and I have simply created an own
> schema for every database with the same name, but it still does not
> work. Is there anything plain and simple?

SELECT f.one, b.two
FROM
    one_schema.foo AS f
JOIN
    other_schema.bar AS b
ON (f.id = b.foo_id)
WHERE...

Cheers,
David.
-- 
David Fetter <david@xxxxxxxxxx> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@xxxxxxxxx

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux