IMPORT
CREATE TABLE persons (
id SERIAL,
first_name VARCHAR(50),
last_name VARCHAR(50),
dob DATE,
email VARCHAR(255),
PRIMARY KEY (id)
)
COPY persons(first_name, last_name, dob, email)
FROM 'C:\sampledb\persons.csv'
DELIMITER ','
CSV HEADER;
EXPORT
\copy (SELECT * FROM persons) to '\tmp\persons_client.csv' with csv
반응형
'SW ENGINEERING > Postgres' 카테고리의 다른 글
[PostgreSQL] BASIC - Data Types - 2 (0) | 2021.09.06 |
---|---|
[PostgreSQL] BASIC - Data Types - 1 (0) | 2021.09.06 |
[PostgreSQL] BASIC - Transaction (0) | 2021.09.06 |
[PostgreSQL] BASIC - Upsert (0) | 2021.09.06 |
[PostgreSQL] BASIC - DELETE (0) | 2021.09.06 |
최근댓글