I have a Database which has multiple schema, I need to export one of those schema structure to an sql file without the data. Is this possible, if so What command should I use?
When I use this command, I get the data as well, but I have a lot of data which makes the server run out of space for this.
--host xx --port xx --username "xx" --password --format plain --verbose --file "sample.sql" --schema "sample" "main"
I need the structure to restore it in another location. Where I do not need the data but only the structure
I'm quite new to this area, thanks for the help
Use can use pg_dump with the option -s. Follow the link pg_dump help
To extract the schema for a single database, use
pg_dump -s <schema_name>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With