POSTGRESQL Database Import and Export

Source: Internet
Author: User
Tags postgresql psql

    1. Import the entire database

      Psql-u postgres (user name) database name (default is the same as user name) </data/dum.sql

    2. Export the entire database

      Pg_dump-h localhost-u postgres (user name) database name (default is the same as user name) >/data/dum.sql

    3. Export a table

      Pg_dump-h localhost-u postgres (user name) database name (default is the same as user name)-T table (table name) >/data/dum.sql

    4. Compression method

      Generally using dump to export data will be larger, we recommend using XZ compression

      Compression method XZ Dum.sql generates DUM.SQL.XZ files

    5. XZ Compression Data Countdown database method

      Xzcat/data/dum.sql.xz | Psql-h localhost-u postgres (user name) database name (default is the same as user name)

POSTGRESQL Database Import and Export

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.