Re: Pg backup - Mailing list pgsql-admin

From Laurenz Albe
Subject Re: Pg backup
Date
Msg-id f82cf06b30eb9c727289ce909f3a8f180209dde6.camel@cybertec.at
Whole thread Raw
In response to Pg backup  (Nikhil Ingale <niks.bgm@gmail.com>)
Responses Re: Pg backup  (Nikhil Ingale <niks.bgm@gmail.com>)
List pgsql-admin
On Wed, 2022-10-12 at 16:29 +0530, Nikhil Ingale wrote:
> How do I take the backup of all the tables (no table data, no functions and other objects) only from one schema and
restoreto another schema?
 

Perform a dump with

 pg_dump --schema=yourschema --schema-only dbname

Create a new database, restore the dump into the new database, rename the schema there,
dump the new database and drop it, then import the new dump into the original database.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com



pgsql-admin by date:

Previous
From: Zaid Shabbir
Date:
Subject: Re: SSL Implementation
Next
From: Ebin Jozer
Date:
Subject: Postgresql community edition upgrade