Create SQL INSERT commands from table data

Sometimes you want to provide the data of a table as SQL INSERT command.
 

 

Solution

1. Open a (Windows) cmd promt

2. Go to the PostgreSql bin folder (e.g. cd C:\Program Files\PostgreSQL\13\bin)

3. Run "pg_dump -U {postgres user} --table={tabel data to backup} --data-only --column-inserts {database to backup} > {destination file like ... c:/temp/temdata.sql}"