1

How can I copy a text file as a single column in PostgreSQL (basically copy a text file with no delimiters for columns)?

drop table if exists txt_file;
create temp table txt_file
(
string text
);

copy txt_file (string) from '(...)/functions.txt' csv;

1 Answers1

0

You can't, unless you can identify two characters which are never in the file to specify as the delimiter and quote mark. Otherwise, you will have to preprocess the file to escape things appropriately.

jjanes
  • 37,812
  • 5
  • 27
  • 34