How to take backup of schema postgresql? 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 ?
You export only schema without data using pg_dump in psql [terminal]:
pg_dump -U postgres -s databasename &gt; backup.sql

or with Pgadmin4

Go to Tool -&gt; Backup and select only schema in the Dump option.