mirror of
https://github.com/dimitri/pgloader.git
synced 2025-08-06 22:37:02 +02:00
21 lines
478 B
Fish
21 lines
478 B
Fish
LOAD CSV
|
|
FROM INLINE (id, number [null if '\N'], data)
|
|
INTO postgresql:///pgloader?nullif
|
|
|
|
BEFORE LOAD DO
|
|
$$ drop table if exists nullif; $$,
|
|
$$ CREATE TABLE nullif
|
|
(
|
|
id serial primary key,
|
|
number integer,
|
|
data text
|
|
);
|
|
$$
|
|
|
|
WITH fields terminated by ',',
|
|
fields enclosed by '"',
|
|
fields escaped by backslash-quote;
|
|
|
|
|
|
"1",\N,"testing nulls"
|
|
"2","2","another test" |