PostgreSQL data table converted to Excel

Source: Internet
Author: User
Tags postgresql

COPY at PostgreSQL Exchange data between a table and a standard file system file. COPYTO Copy all the contents of a table to a file, and COPYFROM copy data from a file into a table (append the data to the existing content in the tables).

COPY table name to ' file name . csv ' csv HEADER;

Note:CSV

open Comma separated variables (CSV ) mode.

HEADER

The declaration file contains a header identification row that contains the name of each field in the file. When output, the first row contains the field name of the table, and the first row is ignored when entered.


A COPY with the file name instructs the PostgreSQL server to read and write data directly from the file. If a file name is declared, it must be visible to the server, and the filename must be declared from the server's perspective. If STDIN or STDOUTis declared, the data flows through the connection between the customer's front end and the server.

Http://www.php100.com/manual/PostgreSQL8/sql-copy.html



PostgreSQL data table converted to Excel

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.