Question

Hi I am currently using postgresql and deleting some of the tables for testing purpose and I want to take backup of schema. can any one let me know how to do that ?

Was it helpful?

Solution

You export only schema without data using pg_dump in psql [terminal]:

pg_dump -U postgres -s databasename > backup.sql

or with Pgadmin4

  1. Go to Tool -> Backup and select only schema in the Dump option.

Screenshot of Backup

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top