Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to export Postgres schema/data to plain SQL in PgAdmin 4

I read a few similar posts and find that they did not specify how to export SQLs to custom files. I will walk through steps with screenshots here.

reference reference

like image 423
Yu Tian Toby Avatar asked Mar 21 '26 17:03

Yu Tian Toby


1 Answers

  1. right click on a table/schema/database and click 'Backup' in the menu.

enter image description here

  1. set export file format to 'Plain'

enter image description here

  1. select the custom file created to save the backup scripts

enter image description here

and double click to confirm

enter image description here

  1. open 'dump options' tab to set dump options

enter image description here

  1. set dump options

enter image description here

enter image description here

  1. set 'Use INSERT commands' so the exported sql is runnable when original table/schema/database is deleted

enter image description here

  1. click 'Backup' button to start process

enter image description here

  1. PgAdmin shows success message when backup is done

enter image description here

like image 166
Yu Tian Toby Avatar answered Mar 23 '26 06:03

Yu Tian Toby



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!