How to query two postgres databases (with a single query) when the databases are within the same postgres...












0
















This question already has an answer here:




  • Joining Results from Two Separate Databases

    7 answers



  • Possible to perform cross-database queries with postgres?

    6 answers



  • Cross Database Query in PostgreSQL [duplicate]

    1 answer




For example, assuming that table A is in database example and table B is in database postgres, how to perform the following query on the two tables?:



SELECT
A.date,
A.name,
B.date,
B.name
FROM A
INNER JOIN B ON A.name = B.name;


enter image description here










share|improve this question













marked as duplicate by a_horse_with_no_name postgresql
Users with the  postgresql badge can single-handedly close postgresql questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 14 '18 at 6:35


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
















  • Your previous answer was correct, the linked question is about two databases which are located on different postgres servers, whereas your answer was for two databases in the same postgres server

    – Greg
    Nov 14 '18 at 2:48











  • Yes syntax correct but it cannot produce because foreign key cannot connect to other database.. Postgresql cannot do Query joining on Across Database..

    – dwir182
    Nov 14 '18 at 2:54











  • @Greg: it doesn't matter if the database are on the same server or different servers. In both cases you would use a foreign data wrapper: stackoverflow.com/a/36904631

    – a_horse_with_no_name
    Nov 14 '18 at 6:35
















0
















This question already has an answer here:




  • Joining Results from Two Separate Databases

    7 answers



  • Possible to perform cross-database queries with postgres?

    6 answers



  • Cross Database Query in PostgreSQL [duplicate]

    1 answer




For example, assuming that table A is in database example and table B is in database postgres, how to perform the following query on the two tables?:



SELECT
A.date,
A.name,
B.date,
B.name
FROM A
INNER JOIN B ON A.name = B.name;


enter image description here










share|improve this question













marked as duplicate by a_horse_with_no_name postgresql
Users with the  postgresql badge can single-handedly close postgresql questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 14 '18 at 6:35


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
















  • Your previous answer was correct, the linked question is about two databases which are located on different postgres servers, whereas your answer was for two databases in the same postgres server

    – Greg
    Nov 14 '18 at 2:48











  • Yes syntax correct but it cannot produce because foreign key cannot connect to other database.. Postgresql cannot do Query joining on Across Database..

    – dwir182
    Nov 14 '18 at 2:54











  • @Greg: it doesn't matter if the database are on the same server or different servers. In both cases you would use a foreign data wrapper: stackoverflow.com/a/36904631

    – a_horse_with_no_name
    Nov 14 '18 at 6:35














0












0








0









This question already has an answer here:




  • Joining Results from Two Separate Databases

    7 answers



  • Possible to perform cross-database queries with postgres?

    6 answers



  • Cross Database Query in PostgreSQL [duplicate]

    1 answer




For example, assuming that table A is in database example and table B is in database postgres, how to perform the following query on the two tables?:



SELECT
A.date,
A.name,
B.date,
B.name
FROM A
INNER JOIN B ON A.name = B.name;


enter image description here










share|improve this question















This question already has an answer here:




  • Joining Results from Two Separate Databases

    7 answers



  • Possible to perform cross-database queries with postgres?

    6 answers



  • Cross Database Query in PostgreSQL [duplicate]

    1 answer




For example, assuming that table A is in database example and table B is in database postgres, how to perform the following query on the two tables?:



SELECT
A.date,
A.name,
B.date,
B.name
FROM A
INNER JOIN B ON A.name = B.name;


enter image description here





This question already has an answer here:




  • Joining Results from Two Separate Databases

    7 answers



  • Possible to perform cross-database queries with postgres?

    6 answers



  • Cross Database Query in PostgreSQL [duplicate]

    1 answer








postgresql






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 14 '18 at 0:28









GregGreg

1,87041843




1,87041843




marked as duplicate by a_horse_with_no_name postgresql
Users with the  postgresql badge can single-handedly close postgresql questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 14 '18 at 6:35


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by a_horse_with_no_name postgresql
Users with the  postgresql badge can single-handedly close postgresql questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 14 '18 at 6:35


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.















  • Your previous answer was correct, the linked question is about two databases which are located on different postgres servers, whereas your answer was for two databases in the same postgres server

    – Greg
    Nov 14 '18 at 2:48











  • Yes syntax correct but it cannot produce because foreign key cannot connect to other database.. Postgresql cannot do Query joining on Across Database..

    – dwir182
    Nov 14 '18 at 2:54











  • @Greg: it doesn't matter if the database are on the same server or different servers. In both cases you would use a foreign data wrapper: stackoverflow.com/a/36904631

    – a_horse_with_no_name
    Nov 14 '18 at 6:35



















  • Your previous answer was correct, the linked question is about two databases which are located on different postgres servers, whereas your answer was for two databases in the same postgres server

    – Greg
    Nov 14 '18 at 2:48











  • Yes syntax correct but it cannot produce because foreign key cannot connect to other database.. Postgresql cannot do Query joining on Across Database..

    – dwir182
    Nov 14 '18 at 2:54











  • @Greg: it doesn't matter if the database are on the same server or different servers. In both cases you would use a foreign data wrapper: stackoverflow.com/a/36904631

    – a_horse_with_no_name
    Nov 14 '18 at 6:35

















Your previous answer was correct, the linked question is about two databases which are located on different postgres servers, whereas your answer was for two databases in the same postgres server

– Greg
Nov 14 '18 at 2:48





Your previous answer was correct, the linked question is about two databases which are located on different postgres servers, whereas your answer was for two databases in the same postgres server

– Greg
Nov 14 '18 at 2:48













Yes syntax correct but it cannot produce because foreign key cannot connect to other database.. Postgresql cannot do Query joining on Across Database..

– dwir182
Nov 14 '18 at 2:54





Yes syntax correct but it cannot produce because foreign key cannot connect to other database.. Postgresql cannot do Query joining on Across Database..

– dwir182
Nov 14 '18 at 2:54













@Greg: it doesn't matter if the database are on the same server or different servers. In both cases you would use a foreign data wrapper: stackoverflow.com/a/36904631

– a_horse_with_no_name
Nov 14 '18 at 6:35





@Greg: it doesn't matter if the database are on the same server or different servers. In both cases you would use a foreign data wrapper: stackoverflow.com/a/36904631

– a_horse_with_no_name
Nov 14 '18 at 6:35












0






active

oldest

votes

















0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes

這個網誌中的熱門文章

Hercules Kyvelos

Tangent Lines Diagram Along Smooth Curve

Yusuf al-Mu'taman ibn Hud