Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
linux:database:postgresql:import_with_copy [2019/06/14 12:38] jlucas |
linux:database:postgresql:import_with_copy [2019/06/14 12:46] (current) jlucas |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | By default, when you export data from postgres, it does not use a standard CSV format. | + | Using PostgreSQL. |
- | | + | |
- | To correct for the default format of the export, perform | + | To import |
- | | + | sudo -u system_user psql -d database -c "\copy table_name FROM '/ |
- | + | ||
- | Then, you can import the data like this: | + | |
- | + | ||
- | | + | |
- | + | ||
- | sudo -u system_user psql -c "\copy table_name FROM STDIN (format csv, delimiter ',' | + |