Search Postgresql Archives

Re: csv copy error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday, December 29, 2021, Adrian Klaver <adrian.klaver@xxxxxxxxxxx> wrote:
On 12/29/21 13:08, ourdiaspora wrote:

"
  \copy exampletable from '/local/path/to/examplefile.csv';
"

\copy exampletable from '/local/path/to/examplefile.csv with csv';


Right idea though that won’t execute for three reasons (bad quoting, missing parentheses, missing field type for the value csv).  The main issue is the OP is accepting all defaults but the file format is not in the default format.  Either the format needs to be changed or the OP needs to specify a combination of options that describes the file format.  Specifying the csv format I think is a valid solution though there are others.  The documentation describes the options, syntax, and effects sufficiently so I will not belabor the details.

David J.
 

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux