From: Samed YILDIRIM <samed@reddoc.net>
To: Ashwani Kumar B <ashwani.b.kumar@ericsson.com>
To: Arnaud Gambonnet <arnaud.gambonnet@gmail.com>
To: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: How to load data in psql DB
Date: Wed, 31 May 2017 13:13:19 +0300
Message-ID: <948971496225599@web2j.yandex.ru> (raw)
In-Reply-To: <AM3PR07MB35489CAE9D57C1CB92E07F5C0F10@AM3PR07MB354.eurprd07.prod.outlook.com>
References: <AM3PR07MB35497930F2C4FABB67B75D5C0F10@AM3PR07MB354.eurprd07.prod.outlook.com>
<CAEUKC0jwVg6o9=uNmhuhaSfUCNGRw3QFEVucj2H5P81F5ZgvOQ@mail.gmail.com>
<AM3PR07MB35489CAE9D57C1CB92E07F5C0F10@AM3PR07MB354.eurprd07.prod.outlook.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>
<div>Hi Ashwani,</div><div> </div><div>You can use COPY command and psql to load CSV file to PostgreSQL.</div><div> </div><div>\copy zip_codes FROM '/path/to/csv/ZIP_CODES.txt' DELIMITER ',' CSV</div><div> </div><div>If you create a simple cronjob, it will periodically load your datas from CSV.</div><div> </div><div>https://stackoverflow.com/questions/2987433/how-to-import-csv-file-data-into-a-postgresql-table</... href="https://www.postgresql.org/docs/9.6/static/sql-copy.html">https://www.postgresql.org/docs/9.6... regards.</div><div> </div><div> </div><div><br /></div><div><br /></div><div>İyi çalışmalar.</div><div>Samed YILDIRIM</div><div><br /></div><div><br /></div><div><br /></div><div>31.05.2017, 10:57, "Ashwani Kumar B" <ashwani.b.kumar@ericsson.com>:</div><blockquote type="cite">
<div lang="EN-US" link="blue" vlink="purple">
<div>
<p><span style="font-size:11pt;font-family:Calibri,sans-serif;color:#1F497D;">Hi</span></p>
<p><span style="font-size:11pt;font-family:Calibri,sans-serif;color:#1F497D;"> </span></p>
<p><span style="font-size:11pt;font-family:Calibri,sans-serif;color:#1F497D;">It will be helpful if you share any sample script which works in crontab and also sample of control file.</span></p>
<p><span style="font-size:11pt;font-family:Calibri,sans-serif;color:#1F497D;"> </span></p>
<p><span style="font-size:11pt;font-family:Calibri,sans-serif;color:#1F497D;">Regards</span></p>
<p><span style="font-size:11pt;font-family:Calibri,sans-serif;color:#1F497D;">Ashwani</span></p>
<p><span style="font-size:11pt;font-family:Calibri,sans-serif;color:#1F497D;"> </span></p>
<p><b><span style="font-size:10pt;font-family:Tahoma,sans-serif;">From:</span></b><span style="font-size:10pt;font-family:Tahoma,sans-serif;"> <a href="mailto:pgsql-admin-owner@postgresql.org">pgsql-admin-owner@postgresql.org</a> [mailto:<a href="mailto:pgsql-admin-owner@postgresql.org">pgsql-admin-owner@postgresql.org</a>]
<b>On Behalf Of </b>Arnaud Gambonnet<br />
<b>Sent:</b> Wednesday, May 31, 2017 1:03 PM<br />
<b>To:</b> <a href="mailto:pgsql-admin@postgresql.org">pgsql-admin@postgresql.org</a><br />
<b>Subject:</b> Re: [ADMIN] How to load data in psql DB</span></p>
<p> </p>
<div>
<p>Hi,</p>
<div>
<p> </p>
</div>
<div>
<p>pgloader should fit your need.</p>
</div>
<div>
<p> </p>
</div>
<div>
<p>=> <a href="http://pgloader.io/">http://pgloader.io</a></p;
</div>
<div>
<p> </p>
</div>
<div>
<p>Regards,</p>
</div>
<div>
<p>AG.</p>
</div>
</div>
<div>
<p> </p>
<div>
<p><span>2017-05-31 8</span>:30 GMT+02:00 Ashwani Kumar B <<a href="mailto:ashwani.b.kumar@ericsson.com" target="_blank">ashwani.b.kumar@ericsson.com</a>>:</p>
<div>
<div>
<p>Hi</p>
<p> </p>
<p>My requirement is to automatically load data which is in CSV format to psql DB table.</p>
<p> </p>
<p>Normally in oracle I use to do it through sql-loader [<b><i>sqlldr] .
</i></b>Do we have anything similar in psql.</p>
<p> </p>
<p>Regards</p>
<p><span style="color:#888888;">Ashwani<b><i>
</i></b></span></p>
</div>
</div>
</div>
<p> </p>
</div>
</div>
</div>
</blockquote>
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 using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: samed@reddoc.net, ashwani.b.kumar@ericsson.com, arnaud.gambonnet@gmail.com
Subject: Re: How to load data in psql DB
In-Reply-To: <948971496225599@web2j.yandex.ru>
* 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