Hi Guys,
I have an ETL which writes to a Postgres database, before the writer begins the translation I would like the writer to run a script in Postgres to backup the database schema (including tables and indexes) as either a backup or sql file. I can run a script to backup/dump the entire database however I would just like to backup the schema.
Creating a backup of the schema using the pg dump utility within PgAdmin 4 looks something like this
--file "P:\\\\FINANCEBBK.BAC" --host "myserver" --port "5432" --username "postgres" --no-password --verbose --role "postgres" --format=c --blobs --encoding "UTF8" --schema "finance" "mydatabase"
Any help greatly appreciated,
Chris