pg_dump windows command prompt invalid command pg_dump windows command prompt invalid command postgresql postgresql

pg_dump windows command prompt invalid command


You are running pg_dump from psql. Get out of psql and run pg_dump command from Windows Command prompt. pg_dump is its own executable, different from psql.


This works for me in Windows PowerShell in Windows 10:

.\pg_dump.exe --username "yourUserName" --no-owner "yourDatabasName" >./filename.sql


Steps to using pg_dump on windows

  1. Access cmd as Admin and type
  2. cd path_to_pg_dump PRESS ENTER
  3. pg_dump --username your_user_name--table=table_name --data-only --column-inserts your_database > my_table_data.sql
    PRESS ENTER