The COPY FROM STDIN
command imports data directly from the client into a table. It simplifies the copy process by eliminating the need to transfer files to the server.
The syntax for this function is as follows:
table_name
: table where the data will be importedstdin
: data coming from the standard input (client application)When it comes to file format, only CSV files are supported and the default delimiter for this format is a comma ,
.
1. Listing Column Names
You can specify the columns into which the data should be imported.
2. Options
You can include additional options following FROM stdin
to customize the import process.
You should see the output indicating that the table has been created.
Paste the data directly from your CSV file into the prompt:
If the import is successful, you will see IMPORT 0
at the end of the line.
The output from that query should be as follows:
Use the following steps to import a CSV file directly into your Oxla instance. This method bypasses the need to manually enter data by reading the file and importing it directly into Oxla. After launching the psql
client application and creating the film
table, download the film-dataset.csv file and execute the following query:
table_name
with your target table name/path/to/file
with the full path to your CSV fileHEADER
if your CSV file includes column headerscat
MethodEnsure your dataset is in a valid CSV format. After creating a table using psql
, please follow the following steps:
\q
followed by Enter
to exit psql
This command reads the contents of film-dataset.csv file and passes it directly to the COPY
command.
The COPY FROM STDIN
command imports data directly from the client into a table. It simplifies the copy process by eliminating the need to transfer files to the server.
The syntax for this function is as follows:
table_name
: table where the data will be importedstdin
: data coming from the standard input (client application)When it comes to file format, only CSV files are supported and the default delimiter for this format is a comma ,
.
1. Listing Column Names
You can specify the columns into which the data should be imported.
2. Options
You can include additional options following FROM stdin
to customize the import process.
You should see the output indicating that the table has been created.
Paste the data directly from your CSV file into the prompt:
If the import is successful, you will see IMPORT 0
at the end of the line.
The output from that query should be as follows:
Use the following steps to import a CSV file directly into your Oxla instance. This method bypasses the need to manually enter data by reading the file and importing it directly into Oxla. After launching the psql
client application and creating the film
table, download the film-dataset.csv file and execute the following query:
table_name
with your target table name/path/to/file
with the full path to your CSV fileHEADER
if your CSV file includes column headerscat
MethodEnsure your dataset is in a valid CSV format. After creating a table using psql
, please follow the following steps:
\q
followed by Enter
to exit psql
This command reads the contents of film-dataset.csv file and passes it directly to the COPY
command.