Importing Data
You can use GDS, INSERT, COPY, or \copy (a gsql meta-command) to import data to GaussDB. GDS has high efficiency because of its parallel import and is used to import large volume of data. The rest statements and commands are used to import small volume of data. For details, see Table 1.
Method |
Feature |
---|---|
GDS |
Multiple DNs are used for parallel import, improving the efficiency. It is recommended for importing a large volume of data. |
INSERT |
Insert one or more rows of data, or insert data from a specified table. |
COPY |
Run the COPY FROM STDIN statement to write data into GaussDB. Service data does not need to be stored in files when it is written from other databases to GaussDB through the CopyManager interface driven by JDBC. |
\copy, a gsql meta-command |
Different from the SQL COPY statement, the \copy command can read data from or write data into only local files on a gsql client.
NOTE:
\copy applies only to small-scale data import in good format. It does not preprocess invalid characters or provide error tolerance. Therefore, \copy cannot be used in scenarios where abnormal data exists. GDS or COPY is preferred for data import. |
- Importing Data in Parallel Using Foreign Tables
- Running the INSERT Statement to Insert Data
- Running the COPY FROM STDIN Statement to Import Data
- Using a gsql Meta-Command to Import Data
- Updating Data in a Table
- Deep Copy
- Checking for Data Skew
- Analyzing Tables
- Doing VACUUM to a Table
- Managing Concurrent Write Operations
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot