on-internet
← Community

How do I import data from a text file into a postgres database?

Stack Overflow ·

I've created a table that has two columns: both varchars for numbers. My text file also has two columns, separated by commas. Here's the command I'm using (italics used to distinguish from syntax): COPY *table_name* FROM '*/C:/Users/username/Desktop/filename.txt*' DELIMITER ',' CSV; I'm getting this error: ERROR: "COPY FROM 'filename'..." not currently supported Everywhere I read says that I need to use the COPY FROM command, yet the error says it's not supported. I've tried changing forward slashes to backslashes and double backslashes as well.

Comments

Sign in or sign up to comment and upvote.

No comments yet.