Re: Load multiple CSV file in Postgres using COPY

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: John R Pierce <pierce(at)hogranch(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Load multiple CSV file in Postgres using COPY
Date: 2017-02-17 06:00:31
Message-ID: CABUevEybjAtdrFZnr15bpV2cjDDeX6wOd5rPiSAjtgB8ELvjRA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Feb 17, 2017 06:53, "John R Pierce" <pierce(at)hogranch(dot)com> wrote:

On 2/16/2017 9:43 PM, Magnus Hagander wrote:

>
Perhaps something like "COPY FROM PROGRAM 'cat /path/*.csv'" would work for
you?

he's using HEADER, so cat wouldn't work. he's also using MSDOS/WIndows
style filenames, so cat won't work, anyways..

There are windows equivalents of cat.. But you're right, I didn't think of
the header part.

I'd suggest using something like pgloader, but I don't know if that runs on
MS Windows, either. its very powerful for doing bulk imports from a wide
range of formats, and even allows data manipulation.

I assume it does if you can figure out how to build it. But I don't think
there are any packages provided for it, so it can be a bit of a challenge.

/Magnus

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Tyson 2017-02-17 07:18:20 "Database does not exist" weirdness
Previous Message John R Pierce 2017-02-17 05:51:11 Re: Load multiple CSV file in Postgres using COPY