From: Adrian Klaver <adrian.klaver@aklaver.com>
To: pavan95 <pavan.postgresdba@gmail.com>
To: pgsql-general@postgresql.org
Subject: Re: Copying data from a CSV file into a table dynamically
Date: Tue, 14 Aug 2018 07:04:31 -0700
Message-ID: <f2d796ab-ad65-8fe9-a217-8ba054a6cc25@aklaver.com> (raw)
In-Reply-To: <1534253907682-0.post@n3.nabble.com>
References: <1534252253597-0.post@n3.nabble.com>
<318228ff-6861-8a69-981f-48cb528a0dd9@aklaver.com>
<1534253907682-0.post@n3.nabble.com>
On 08/14/2018 06:38 AM, pavan95 wrote:
> Hi Adrian,
>
> I tried to use
> *"COPY postgres_log1 FROM '/tmp/abc/xyz/postgresql-`date --date="0 days ago"
> +%Y-%m-%d`_*.csv' WITH csv;"*
>
> But it resulted in an error. How to issue such that it is understandable by
> psql?
>
> And I am completely unaware of python & psycopg2. Anything which suits my
> requirement is enough!!
Well I was just using that as an example. If you are not familiar with
Python then you would probably be better off using a language and it's
associated Postgres adapter you are comfortable with.
>
> Thanks in Advance
>
> Regards,
> Pavan
>
>
>
> --
> Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html
>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: adrian.klaver@aklaver.com, pavan.postgresdba@gmail.com
Subject: Re: Copying data from a CSV file into a table dynamically
In-Reply-To: <f2d796ab-ad65-8fe9-a217-8ba054a6cc25@aklaver.com>
References: <1534252253597-0.post@n3.nabble.com> <318228ff-6861-8a69-981f-48cb528a0dd9@aklaver.com> <1534253907682-0.post@n3.nabble.com> <f2d796ab-ad65-8fe9-a217-8ba054a6cc25@aklaver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox