Обсуждение: Re: csv improt to table
I read the documentation and built a command and tried it and got a syntax error. Before I ran the command, I changed all single quotes in the csv file to double quotes. I copied the command and the generated error onto my clipboard so what follows is a paste into this message. Cut here. copy to health /home/jude/health.csv format csv header force-not-null; ERROR: syntax error at or near "to" LINE 1: copy to health /home/jude/health.csv format csv header force... I could have left out force-not-null but decided to try it and I am rather certain that last command parameter is not the reason for this syntax error. --
On Saturday, June 13, 2015, Jude DaShiell <jdashiel@panix.com> wrote:
Re-read the syntax and examples on this page. Your first problem, as noted by the error message, is that the word "to" does not immediately follow the word copy.
http://www.postgresql.org/docs/9.4/interactive/sql-copy.html
I read the documentation and built a command and tried it and got a syntax error.
http://www.postgresql.org/docs/9.4/interactive/sql-copy.html
Before I ran the command, I changed all single quotes in the csv file to double quotes. I copied the command and the generated error onto my clipboard so what follows is a paste into this message.
Cut here.
copy to health /home/jude/health.csv format csv header force-not-null;
ERROR: syntax error at or near "to"
LINE 1: copy to health /home/jude/health.csv format csv header force...
David J.
For the list - where does one go (point others) to learn how to read the syntax blocks that are provided in our documentation?
David J.
On Saturday, June 13, 2015, David G. Johnston <david.g.johnston@gmail.com> wrote:
On Saturday, June 13, 2015, David G. Johnston <david.g.johnston@gmail.com> wrote:
On Saturday, June 13, 2015, Jude DaShiell <jdashiel@panix.com> wrote:I read the documentation and built a command and tried it and got a syntax error.Re-read the syntax and examples on this page. Your first problem, as noted by the error message, is that the word "to" does not immediately follow the word copy.
http://www.postgresql.org/docs/9.4/interactive/sql-copy.htmlBefore I ran the command, I changed all single quotes in the csv file to double quotes. I copied the command and the generated error onto my clipboard so what follows is a paste into this message.
Cut here.
copy to health /home/jude/health.csv format csv header force-not-null;
ERROR: syntax error at or near "to"
LINE 1: copy to health /home/jude/health.csv format csv header force...David J.