Re: Importing from CSV, auto creating table?

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Ron <ronljohnsonjr(at)gmail(dot)com>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Importing from CSV, auto creating table?
Date: 2019-08-22 03:14:41
Message-ID: CAKFQuwbc6qCLWAdusCz69KqgyWAssXbGB4QFWShFT-c45ETNVA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wednesday, August 21, 2019, Ron <ronljohnsonjr(at)gmail(dot)com> wrote:

> On 8/21/19 4:15 PM, stan wrote:
>
>> I have a situation where we need to import data, as an interim measure,
>> from spreadsheets.
>>
>> I have read up on \copy and COPY, but I do not see that either of these
>> can
>> use the header from a CSV file to define a new table. Am I missing
>> something?
>>
>
> Data types. Sure, you've got column names from the header line, but what
> types do you assign them?

Text. I’m gonna post-process anyway, casting to better types isn’t a
problem.

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2019-08-22 03:43:31 Re: Rename a column if not already renamed.?
Previous Message Ron 2019-08-22 02:36:17 Re: Importing from CSV, auto creating table?