简体   繁体   中英

How can I copy data from CSV to database with Tables and Composite Types using Postgres

I have redesigned a given database to an Object-Relational Database, I've created tables and composite types with Postgres and I have a hard time copying values from CSV that I've used for the previous form of the db, to the redesigned one due to the existence of composite types in the place of some tables. Is there any version of the "copy" query that fits for tables that include composite types?

"The data to be entered for the composed type column are to be enclosed within paretheses. The single sub-columns are to be comma separated."

COPY atable( somedata,ct ) FROM STDIN;

Copied from (edited for grammar): http://www.postgresql.org/message-id/200712261431.04689.regmeplease@gmail.com

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM