Answer the question
In order to leave comments, you need to log in
How to copy a table from one schema to another [PostgreSQL] ?
There is a base with two schemes - temp and public.
Public contains an empty TableOriginal table. There is no such table in the temp schema.
It is necessary to copy the TableOriginal table into the temp schema.
Schemas cannot be renamed because the set of tables and data in them differ.
In SQL Shell (psql) after entering the command:
CREATE TABLE temp.TableOriginal AS SELECT * FROM public.TableOriginal
Answer the question
In order to leave comments, you need to log in
CREATE TABLE "temp"."TableOriginal" AS SELECT * FROM "public"."TableOriginal"
It is possible to peep ddl, create a table. And then in a swoop throw all the data
INSERT INTO newshema.table select * from oldshema.table;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question