COPY table_name (column_name) FROM {'file_path' | STDIN}
WITH (option);
table_name
: existing table where the data will be importedcolumn_name
: optional list of columns to be copiedFROM
: either file_path
(path to your CSV file) or STDIN
(data coming from the standard input)option
: one of the following to be selected:
IMPORT 0
at the end of the line, indicating no fatal error.
psql
client application and creating the film
table, follow these steps:
table_name
with your target table namefile_path
with the full path to your CSV fileHEADER
if your CSV file includes column headerscat
method, you’ll need to pipe the contents of your CSV file directly into the psql
command. Make sure that your dataset is in a valid CSV format. After creating a table using psql
, follow these steps:
1. Exit psql
Type \q
followed by hitting the Enter
button
2. Import the CSV File
Run the following command using your terminal:
COPY
command.
COPY FROM
command with object storage credentials.nThis command allows you to transfer data from cloud storage services like AWS S3, Google Cloud Storage or Azure Blob Storage directly into your Oxla instance.
object storage
: AWS_CRED
,AZURE_CRED
or GCS_CRED
(depending on your provider)object_storage_credentials
: for accessing your cloud storageaws_region
: AWS region associated with the storage servicekey_id
: key identifier for authenticationaccess_key
: access key for authenticationendpoint_url
: URL endpoint for the storage service<path_to_credentials>
: path to JSON credentials file<json_credentials_string>
: contents of the GCS’s credentials filetenant_id
: tenant identifier representing your organization’s identity in Azureclient_id
: client identifier used for authenticationclient_secret
: secret identifier acting as a password for authentication