
Zitat von
Kaptain Iglo
Danke für die Antwort. Beim dritten Lesen der Fehlermeldung habe ich gemerkt was der von mir will.
Problem ist das hier noch Gänsefüsschen vorhanden sind.
Sieht also so aus:
"name";"0";"Strasse"
Hier habe ich noch nichts gefunden wie ich postgres sagen soll das er die gänsefüsschen weglassen soll.
Wie wäre es mit dem sinnentnehmenden Lesen der Doku?
Code:
test=# \h copy;
Command: COPY
Description: copy data between a file and a table
Syntax:
COPY table_name [ ( column [, ...] ) ]
FROM { 'filename' | STDIN }
[ [ WITH ] ( option [, ...] ) ]
COPY { table_name [ ( column [, ...] ) ] | ( query ) }
TO { 'filename' | STDOUT }
[ [ WITH ] ( option [, ...] ) ]
where option can be one of:
FORMAT format_name
OIDS [ boolean ]
DELIMITER 'delimiter_character'
NULL 'null_string'
HEADER [ boolean ]
QUOTE 'quote_character'
ESCAPE 'escape_character'
FORCE_QUOTE { ( column [, ...] ) | * }
FORCE_NOT_NULL ( column [, ...] ) |
ENCODING 'encoding_name'
test=# create table bla (f1 text, f2 text);
CREATE TABLE
Time: 4,039 ms
test=*# copy bla from stdin csv delimiter ';' quote '"';
Enter data to be copied followed by a newline.
End with a backslash and a period on a line by itself.
>> "bla";"fasel"
>> \.
Time: 10390,237 ms
test=*# select * from bla;
f1 | f2
-----+-------
bla | fasel
(1 row)
Andreas]
Lesezeichen