use the pg_dump command
command: $ pg_dump -h [hostname/endpoint] -p [port] -U [username] --column-inserts [database_name] > /path/dir/filename.sql
atul@atul-Lenovo-G570:~$ pg_dump -h localhost -p 5432 -U postgres --column-inserts fprofile_db > mydb/mydatasql.sql
atul@atul-Lenovo-G570:~$ pg_dump -h localhost -p 5432 -U postgres --data-only --column-inserts fprofile_db > mydb/mydatasql1.sql
atul@atul-Lenovo-G570:~$ pg_dump -h localhost -p 5432 -U postgres --table users --column-inserts fprofile_db > mydb/user.sql
atul@atul-Lenovo-G570:~$ pg_dump -h localhost -p 5432 -U postgres --table users --data-only --column-inserts fprofile_db > mydb/users1.sql
command: $ psql -h [hostname/endpoint] -p [port] -U [username] [databasename] -f /path/dir/filename.sql
atul@atul-Lenovo-G570:~$ psql -h localhost -p 5432 -U postgres fprofile_test1 -f mydb/mydatasql.sql
reference: https://neon.tech/postgresql/postgresql-administration/postgresql-schema
Reference: https://www.pgadmin.org/docs/pgadmin4/8.13/backup_dialog.html
/home/atul/mydb/mydb.sql
ERROR: Key (id)=(1) already exists.duplicate key value violates unique constraint "test_pkey"
test_id_seq
Comsysapp.com is an educational website. Students and software developers can learn programming language tutorials. Comsysapp is very useful for beginners and professional developers. Comsysapp provides tutorial in easy language. Comsysapp.com has focus on simplicity.
Comsysapp.com provides free tutorials like c, html, css, etc. All tutorials are free for beginner and professionals.
comsysapp.com is not responsible for any mistake. We are not responsible if information made available on our website is incomplete or invalid. But comsysapp.com always try for zero-zero mistake.
comsysapp.com does not collect any data from users. We use Google AdSense advertising on our website. We never ask personal or private information.
copyright © 2023