You can change the backup options to get INSERT statements as below:
1) Set the format to plain.
2) Set type of objects -> Only data to yes. And set queries -> "Use Column Inserts" and "Use Insert Commands" to yes. And then click backup.
On Sat, Dec 12, 2020 at 4:16 AM Jack Royal-Gordon <jackrg@pobox.com> wrote:
Someone else may be able to clarify further, but I believe that pgbackup can write a file that contains insert sql statements in order to recreate the contents of the database. You can choose one or more tables and whether to include the statements to create the tables (along with many many other options).
If you’re talking about exporting the commands that you have typed into a pgAdmin query window, you have the option to save the query directly from that window (prompted when closing the window, Save icon on button bar).