Re: CREATE VIEW question...

From: "Joel Burton" <joel(at)joelburton(dot)com>
To: <j(dot)konzack(at)arcor(dot)de>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: CREATE VIEW question...
Date: 2002-05-02 03:17:08
Message-ID: JGEPJNMCKODMDHGOBKDNAEGBCMAA.joel@joelburton.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

At present, you cannot access data from another database, either with a
VIEW, or any other SQL statement.

You either want to: merge the two databases or dump/restore the needed table
to db2.

In PG 7.3 (still in development), namespaces have been added. While this
technically won't fix cross-database access, it will provide an excellent
solution to many tables in a database, and will provide an effective
solution to problems like this.

In the contrib/ directory (or using the contrib RPM, if that's your style),
you'll find "dblink", which provides a working but hackish way to access
other databases, but I'm not sure that it is ready for prime time.

HTH. Sorry for the bad news.

Joel BURTON | joel(at)joelburton(dot)com | joelburton.com | aim: wjoelburton
Knowledge Management & Technology Consultant

> -----Original Message-----
> From: pgsql-sql-owner(at)postgresql(dot)org
> [mailto:pgsql-sql-owner(at)postgresql(dot)org]On Behalf Of j(dot)konzack(at)arcor(dot)de
> Sent: Wednesday, May 01, 2002 3:53 PM
> To: pgsql-sql(at)postgresql(dot)org
> Subject: [SQL] CREATE VIEW question...
>
>
> Hello there...
>
> I have two databases, called db1 an db2. Database db1 contains a table
> called memberlist.
> Now I will create a view, called members, in database db2 (containig data
> from table memberlist) with the following query:
>
> CREATE VIEW members AS SELECT * FROM db1.memberlist;
>
> ->>> this error is displayed: ERROR; parser: error at or near "."
>
> How can I create a view in one database with data from a second/different
> database?
>
> Jan Konzack
>
>
> -----------------------------------------------------------------------
> Riester-Rente - Kassieren Sie das Geld vom Staat:
> Zum Förderungsrechner! http://www.arcor.de/home/redir.php/riesterrente
> -----------------------------------------------------------------------
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Wolfgang.Fuertbauer 2002-05-02 08:00:47 Re: join-performance problem
Previous Message Oliver Elphick 2002-05-01 20:51:27 Re: CREATE VIEW question...