PostgreSQL under windows imports sql files and exports files

Article directory

1 question

  • Windows local postgres needs to import production data for testing

2 steps

  • Enter the bin of the installation directory, usually

    C:\Program Files\PostgreSQL\13\bin

  • Enter cmd (directly enter cmd in the path window of the folder and press enter)

    insert image description here
    insert image description here

  • Excuting an order

    psql -d database name -h localhost -p 5432 -U postgres -f C:\Users\filename.sql

3 export

  • Enter the postgres bin directory, also git bash here to open the command interface
    insert image description here

  • To execute the pg_dump command, use ./

    ./pg_dump --host localhost --port 5432 --username postgres -f c://dev.sql earp-authoring

Guess you like

Origin blog.csdn.net/lanxing_huangyao/article/details/123219032
Recommended