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 database import and export, postgresql Import and ExportExport a remote database
1. Export the threshold table structure and data to the file threshold. SQL from the database monitor on the remote database IP Address:
pg_dump -t threshold
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),
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
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
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
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
first, the use of Pg_dump:Import and export of databases is one of the most commonly used features, each of which provides tools for this, such as Oracle's Exp/imp,informix Dbexp/dbimp,mysql mysqldump, and PostgreSQL provides a corresponding tool
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.