Answer the question
In order to leave comments, you need to log in
How to specify the name of the base in Select?
Can you please tell me how to specify the name of the database from which you want to select values in the query?
There are 2 databases on 1 server, you need to form 1 large table in one of these databases in another database. Specifically, I would like to execute such a request:
INSERT into БАЗА1.foo_bar (foo_id, bar_id) (
SELECT foo.id, bar.id FROM БАЗА2.foo JOIN bar
WHERE type = 'name'
);
Answer the question
In order to leave comments, you need to log in
postgresql can't query tables in different databases. use dblink or postrges_fdw.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question