RESOLVED: unable to read composite types from CSV files

From: "Ian Bell" <ib(at)ianbellsoftware(dot)com>
To: "'David G(dot) Johnston'" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "'pgsql-novice'" <pgsql-novice(at)postgresql(dot)org>
Subject: RESOLVED: unable to read composite types from CSV files
Date: 2018-04-20 01:55:52
Message-ID: !&!AAAAAAAAAAAYAAAAAAAAADldbAmb6+pIq6nH7MxZl07CgAAAEAAAAERAW1HauQ9Fqt9+D09NmvsBAAAAAA==@ianbellsoftware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hello David,

Very helpful and timely.

Thanks again,

Ian

From: David G. Johnston [mailto:david(dot)g(dot)johnston(at)gmail(dot)com]
Sent: 19 April, 2018 21:18
To: ib(at)ianbellsoftware(dot)com
Cc: pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: unable to read composite types from CSV files

On Thursday, April 19, 2018, Ian Bell <ib(at)ianbellsoftware(dot)com <mailto:ib(at)ianbellsoftware(dot)com> > wrote:

If you don’t mind, could you point out the section in the PostgreSql manual/documentation where this is discussed/explained. I have repeatedly read section 8.16.6 (i.e. Composite Type Input and Output Syntax) but it does not appear to include this detail.

Your problem is lower-level than the composite type, it's not understanding csv. Read the copy docs, csv format section to learn more.

https://www.postgresql.org/docs/9.6/static/sql-copy.html

The syntax for the composite is embedded in a csv file so first you have to parse the csv then you pass the result to the composite input constructor. If you enter it literally in a script file you can ignore the csv format stuff and go immediately to the syntax of the Typed data you wish to create.

David J.

Browse pgsql-novice by date

  From Date Subject
Next Message Ian Bell 2018-04-26 18:25:05 PGAdmin4 debugger - unable to call ltree functions
Previous Message David G. Johnston 2018-04-20 01:17:30 Re: unable to read composite types from CSV files