Quick onboard
Deployment
Data Modeling
Connection
Migration
Query
Operations and Maintenance
Common Maintenance
Partition
Backup and Restore
Expansion
Monitoring
Performance Tuning
Troubleshooting
Reference Guide
Tool guide
Data type
Storage Engine
Executor
Stream
DR (Disaster Recovery)
Configuration
Index
Extension
SQL Reference
Registers a custom data access protocol that can be specified when defining a Database external table.
CREATE [TRUSTED] PROTOCOL <name> (
[readfunc='<read_call_handler>'] [, writefunc='<write_call_handler>']
[, validatorfunc='<validate_handler>' ])
CREATE PROTOCOL associates a data access protocol name with call handlers that are responsible for reading from and writing data to an external data source. You must be a superuser to create a protocol.
The CREATE PROTOCOL command must specify either a read call handler or a write call handler. The call handlers specified in the CREATE PROTOCOL command must be defined in the database.
The protocol name can be specified in a CREATE EXTERNAL TABLE command.
For information about creating and enabling a custom data access protocol, refer to the Example Custom Data Access Protocol documentation.
Database handles external tables of type file, gpfdist, and gpfdists internally. See s3:// Protocol for information about enabling the S3 protocol. Refer to pxf:// Protocol for information about using the pxf protocol.
Any shared library that implements a data access protocol must be located in the same location on all Database segment hosts. For example, the shared library can be in a location specified by the operating system environment variable LD_LIBRARY_PATH on all hosts. You can also specify the location when you define the handler function. For example, when you define the s3 protocol in the CREATE PROTOCOL command, you specify $libdir/gps3ext.so as the location of the shared object, where $libdir is located at $GPHOME/lib.
CREATE PROTOCOL is a Database extension.