I have two databases in the same schema. My db is in Postgres. I want to copy data from any table (for example, a product) of my 1st db into the same table of the 2nd category.
Is it possible to do this with a query?
It is impossible to do this as a single SQL command (at least not without dblink), but the easiest way is probably just to use the channel between two psql - use COPY at both ends, one sends data in CSV format the other receives it.
to try
insert into db1.table1 select * from db2.table2
PostgreSQL.
PostgreSQL
Contrib, dblink:
INSERT INTO product SELECT * FROM dblink ( 'dbname=sourcedb', ' SELECT * FROM product ' ) AS p (id INT, column1 INT, column2 TEXT, …)
.
Source: https://habr.com/ru/post/1765253/More articles:Replace multiple character groups in NSString - objective-cASP.NET MVC - HybridViewResult (ViewResult / PartialViewResult) - c #svnadmin: svndiff contains window too large - svnHow to convert every two consecutive array values to a key / value pair? - arraysMercurialEclipse on Windows 7 64bit: does not install "Windows Binaries for Mercurial" - eclipsehttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1765254/entity-framework-testing-with-irepository-problem-with-lazy-loading&usg=ALkJrhgETtdCpD15WnkYlMnn8jXQJ02KgAASP.NET and jQuery - a call from codebehind - jqueryПроблема с вызовом Ajax с перекрестным доменом с использованием JQuery WCF REST Starter Kit Preview 2 - jqueryCan you have an Excel macro to automatically save a copy in CSV format - excel-vbaHow to add JSONP support in .NET 3.5 WCF REST JSON - jsonpAll Articles