Re: Copying data from a CSV file into a table dynamically

From: pavan95 <pavan(dot)postgresdba(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Copying data from a CSV file into a table dynamically
Date: 2018-08-16 12:58:14
Message-ID: 1534424294780-0.post@n3.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thank you so much Ron. You saved my efforts after a slight modification of
quotes of the command you said, it started working fine.

The modified command is as below:

cat /tmp/xyz/abc/postgresql-`date --date="0 days ago" +%Y-%m-%d`_*.csv |
psql -U aaa -d mydb -c "COPY postgres_log1 FROM STDIN WITH csv;"

Team,

Thank you so much for your valuable time spent on this!!

Regards,
Pavan

--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2018-08-16 13:16:52 Re: regex match and special characters
Previous Message Andreas Joseph Krogh 2018-08-16 12:57:52 Sv: Re: Logical replication from standby