Hi Robert,
I've never able to log in to one database and query data from another
database in my sql queries.
But what will work is if you create one (1) database and put two distince
"schemas" in them. Read the PostgreSQL documentation about schemas. If
you went that route, you'd have one database, call it "myDB" for example.
Then, within myDB, you could create two schemas called "base1" and
"base2". If you had proper permissions on both schema's, then your query
would work. You'd have to modify your query to reference the proper
schemas with something like:
INSERT INTO base1.test(a,b)
VALUES (SELECT a, b
FROM base2.test
)
But other than using schema's like that, I don't know how to query data
from one database while logged in to another. If anyone else knows if/how
this can be done I'd love to learn.
Cheers,
w.k.
On Fri, 6 Feb 2004, RobertG wrote:
Hello
I have 2 databases on PostgreSQL, for instance base1, base2.
I connect to psql: psql -p 3333 base1
how can I access to base2 ?
for instance I wont do instruction:
insert into test(a, b)
values
select a, b
from basa2.test
of course baza2.test isn't valid on PostgreSQL - how can I do it ?
how can I get access to another database ?
sorry for my poor english :)
greet
Robert (from Poland)