Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Data Import and Export

Updated on 2024-06-03 GMT+08:00

This section describes the parameters for importing and exporting data.

raise_errors_if_no_files

Parameter description: Specifies whether to distinguish between the problems "the number of imported file records is empty" and "the imported file does not exist." If this parameter is set to TRUE and the problem "the imported file does not exist" occurs, GaussDB will report the error message "file does not exist."

This is a SUSET parameter. Set it based on instructions provided in Table 1.

Value range: Boolean

  • TRUE indicates that the messages of "the number of imported file records is empty" and "the imported file does not exist" are distinguished when files are imported.
  • FALSE indicates that the messages of "the number of imported file records is empty" and "the imported file does not exist" are not distinguished when files are imported.

Default value: FALSE

safe_data_path

Parameter description: Specifies the path prefix restriction except for the initial user. Currently, the path prefix restriction applies to the COPY operation and advanced packages.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: a string of less than 4096 characters

Default value: NULL

CAUTION:
  • If a soft link file exists in the safe_data_path directory, the system processes the file based on the actual file path to which the soft link points. If the actual path is not in the safe_data_path directory, an error is reported.
  • If a hard link file exists in the safe_data_path directory, it can be used properly. For security purposes, exercise caution when using hard link files. Do not create hard link files that point to other directories in the safe_data_path directory. Ensure that the permission on the safe_data_path directory is minimized.

enable_copy_server_files

Parameter description: Specifies whether to enable the permission to copy server files.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: Boolean

  • on indicates that the permission to copy server files is enabled.
  • off indicates that the permission to copy server files is disabled.

Default value: off

NOTICE:

When the enable_copy_server_files parameter is disabled, only the initial user is allowed to run the COPY FROM FILENAME or COPY TO FILENAME statement. When the enable_copy_server_files parameter is enabled, users with the SYSADMIN permission or users who inherit the gs_role_copy_files permission of the built-in role are allowed to run the COPY FROM FILENAME or COPY TO FILENAME statement.

a_format_load_with_constraints_violation

Parameter description: Specifies whether to enable gs_loader to support no rollback in the case of constraint conflicts.

Parameter type: string

Unit: none

Value range:

  • s1 indicates that gs_loader is enabled to support no rollback in the case of constraint conflicts.
  • '' indicates that gs_loader is not enabled to support no rollback in the case of constraint conflicts.

Default value: ''

Setting method: This is a USERSET parameter. Set it based on instructions provided in Table 1.

Setting suggestion: none.

support_binary_copy_version

Parameter description: Specifies whether the encoding information of the current database server is included when data is exported in BINARY mode using COPY FROM.

Parameter type: string

Unit: none

Value range: '' and header_encoding.

Default value: header_encoding

Setting method: This is a USERSET parameter. Set it based on instructions provided in Table 1.

Setting suggestion: Retain the default value. If forward compatibility is required, leave this parameter empty.

Table 1 Compatibility configuration items

Configuration Item

Behavior

header_encoding

When the binary mode of COPY FROM is used for export, the binary file header contains the encoding information of the current database server.

Empty

Forward compatibility configuration is performed and data is exported in the original binary format.

copy_special_character_version

Parameter description: Determines the processing of invalid characters during data import and export using COPY.

Parameter type: string

Unit: none

Value range: '', no_error, and per_byte.

Default value: ''

Setting method: This is a USERSET parameter. Set it based on instructions provided in Table 1.

Use gsql to connect to the database. If you use the set method, the value is case-insensitive. If you use gs_guc, the value can only be lowercase.

Setting suggestion: none

Table 2 Compatibility configuration items

Configuration Item

Behavior

no_error

When COPY is used to import a data file with the same encoding as that on the server, fault tolerance is performed on the data that does not meet the encoding requirements in the data file. No error is reported and the data with the original codes is inserted into the table.

per_byte

Determines how to process files encoded in GBK or ZHS16GBK when COPY is used to export text files.

After the parameter is set to per_byte, one byte of data is exported at a time. Otherwise, two bytes of data are exported at a time. (One character occupies two bytes if data is encoded in GBK.)

Empty

The default value, which does not affect any function. Forward compatibility is supported. That is, an error is reported when invalid characters are found during COPY.

NOTICE:
  • To ensure that the data to be imported is valid, its encoding must be validated when it is being copied. If this parameter is enabled, verification against invalid encoding will be masked, which causes invalid characters in the field. Therefore, exercise caution before enabling this parameter.
  • Currently, encoding verification is masked only when the server encoding is the same as the data encoding. Client encoding is used by default if not specified.
  • To record fields where invalid encoding exists, you are advised to use the log errors or log errors data parameter in the COPY syntax.
  • In binary mode, copy_special_character_version is set to 'no_error', and it takes effect only for fields of the TEXT, CHAR, VARCHAR, NVARCHAR2, or CLOB type.
  • This parameter is valid only in the database with character sets encoded in UTF-8, GB18030, GB18030_2022, ZHS16GBK, or LATIN1.
  • When the encoding of both the client and server is GBK or ZHS16GBK and the database contains data encoded in an invalid format, if copy_special_character_version is not set to per_byte, the exported data file may contain unexpected data.
  • If copy_special_character_version is set to no_error, this parameter cannot be used together with the COMPATIABLE_ILLEGAL_CHARS parameter in COPY.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback