I want to copy only 4 tables from schema1 to schema2 within the same DB in Postgres. And I would like to save the tables in the schema1. Any idea how to do this in pgadmin as well as in the postgres console?
you can use create table ... like
create table ... like
create table schema2.the_table (like schema1.the_table including all);
Then paste the data from the source to the destination:
insert into schema2.the_table select * from schema1.the_table;
You can use CREATE TABLE AS SELECT. You do not need to embed these methods. A table will be created with the data.
CREATE TABLE schema2.the_table AS SELECT * FROM schema1.the_table;
Source: https://habr.com/ru/post/1656904/More articles:The preferred way to create shared pointers is c ++Тайм-аут для вызова метода QueryRow с использованием пакета database/sql в Голанге - gohow to add a user-defined string to a regular expression - stringRemove “No Chart Data” from MPAndroidChart and add my own message - androidКак обнаружить изменения в компоненте, когда пользователь что-то изменил в представлении в Angular 2? - angularСогласовать 404 с SignalR 2.2.1 в основном приложении Asp.net - iisДокументы AppEngine рекомендуют использовать флаги командной строки вместо элементов файла app.yaml - pythonFind the first missing date in the (Oracle) column - sqlAngular 2 - Mocking - No provider for HTTP - unit-testingData is not updated "DynamiteModule: local module descriptor class for com.google.firebase.auth not found" - androidAll Articles