pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedCREATE VIEW question...
3+ messages / 3 participants
[nested] [flat]
* CREATE VIEW question...
@ 2002-05-01 19:53 j.konzack@arcor.de
0 siblings, 2 replies; 3+ messages in thread
From: j.konzack@arcor.de @ 2002-05-01 19:53 UTC (permalink / raw)
To: pgsql-sql
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
-----------------------------------------------------------------------
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: CREATE VIEW question...
@ 2002-05-01 20:51 Oliver Elphick <olly@lfix.co.uk>
parent: j.konzack@arcor.de
1 sibling, 0 replies; 3+ messages in thread
From: Oliver Elphick @ 2002-05-01 20:51 UTC (permalink / raw)
To: j.konzack@arcor.de; +Cc: pgsql-sql
On Wed, 2002-05-01 at 20:53, j.konzack@arcor.de wrote:
> 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?
You cannot.
When 7.3 comes out, you could implement this as separate schemas within
one database.
--
Oliver Elphick Oliver.Elphick@lfix.co.uk
Isle of Wight http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
"For if ye forgive men their trespasses, your heavenly
Father will also forgive you; But if ye forgive not
men their trespasses, neither will your Father forgive
your trespasses." Matthew 6:14,15
Attachments:
signature.asc (application/pgp-signature, 231B) download
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: CREATE VIEW question...
@ 2002-05-02 03:17 Joel Burton <joel@joelburton.com>
parent: j.konzack@arcor.de
1 sibling, 0 replies; 3+ messages in thread
From: Joel Burton @ 2002-05-02 03:17 UTC (permalink / raw)
To: j.konzack@arcor.de; 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@joelburton.com | joelburton.com | aim: wjoelburton
Knowledge Management & Technology Consultant
> -----Original Message-----
> From: pgsql-sql-owner@postgresql.org
> [mailto:pgsql-sql-owner@postgresql.org]On Behalf Of j.konzack@arcor.de
> Sent: Wednesday, May 01, 2002 3:53 PM
> To: pgsql-sql@postgresql.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
>
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2002-05-02 03:17 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-05-01 19:53 CREATE VIEW question... j.konzack@arcor.de
2002-05-01 20:51 ` Oliver Elphick <olly@lfix.co.uk>
2002-05-02 03:17 ` Joel Burton <joel@joelburton.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox