Backup of PostgreSQL database design - no data
P粉098417223
P粉098417223 2023-08-24 14:29:36
0
1
683
<p>I'm trying to find a way to back up my database design without including the data stored in the database. In fact, one might say I want a file containing all "CREATE Scripts" in the database. Ideally, this file can be used to recreate the database (without the data of course). </p> <p>How to avoid data in database backup? </p> <p>I'm using pgAdmin 4.1.3 and PostgreSQL 9.6. </p>
P粉098417223
P粉098417223

reply all(1)
P粉242741921

You can use it from psql (terminal):

pg_dump -s databasename > file.dump

According to the pg_dump documentation, "-s" only dumps the object definition (schema), not the data.

pg_dump documentation

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template