Export table
Pg_dump-h localhost-u postgres (user name) database name (with user name by default)-T table (table name) > Dump.sql
Import Table
Psql-f Dump.sql
Example of a complete import export table
1, check the original database
-bash-3.2$
PostgreSQL tutorial (18): client commands (2), postgresql tutorial
VII. pg_dump:
Pg_dump is a tool used to back up PostgreSQL databases. It can even perform a full and consistent backup when the database is being used concurrently without blocking
Command operation: data export: pg_dump-Upostgres (User Name) (-t table name) Database Name (lack of time and the same user name) c: fulldb. SQL data import: psql-Upostgres (User Name) Database Name (lack of time and the same user name) C: fulldb.
This article will introduce how to import and export the PG database, the main use is the PG comes with pg_dump, Pg_dumpall, Pg_restore, Psql and other commands, version is 9.4 (different versions of pg_dump \ Pg_ The restore option may be somewhat
Frequently Asked Questions
Need to import data from an other application?
In order to re-create relationships between different records, you shoshould use the unique identifier from the original application and map it to the IDColumn in
Export Import of PostgreSQL dataTo export data from a PostgreSQL database:$ pg_dump-u postgres-f mydatabase.sql mydatabaseWhen importing data, first create the database and then import it with Psql:$ createdb Newdatabase$ psql-d newdatabase-u
The company's communication billing management system has an important function: Text data is imported into the database, the format of text data is:
The analyzed caller number, the analyzed called number, start time (string), End Time (string),
Seven, Pg_dump:
Pg_dump is a tool for backing up the PostgreSQL database. It can even make a full, consistent backup when the database is being used concurrently, without blocking access to the database by other users. The dump format generated by
Objective:
Although the author has released the Docker version, it can be built with just one click (One command).
But in the spirit of learning or to do their own toss over, a key although good but not clear ah.
The official has
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.