COPY command for importing CSV file into PostgreSQL

1124835 pts.
Tags:
CSV file
PostgreSQL
To import my CSV file into my PostgreSQL database, I'm trying to use the COPY command. But here's my question: Does anyone know if I have to have the CSV file in a specific location (where it's stored) or could it just be anywhere? Appreciate the help.
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

You have to specify the path to the file you want to import.

This is from the official documentation:

Parameters:
filename

The absolute path name of the input or output file.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: