Re: How to load data in psql DB

From: Samed YILDIRIM <samed(at)reddoc(dot)net>
To: Ashwani Kumar B <ashwani(dot)b(dot)kumar(at)ericsson(dot)com>, Arnaud Gambonnet <arnaud(dot)gambonnet(at)gmail(dot)com>, "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: How to load data in psql DB
Date: 2017-05-31 10:13:19
Message-ID: 948971496225599@web2j.yandex.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-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</div><div><a href="https://www.postgresql.org/docs/9.6/static/sql-copy.html">https://www.postgresql.org/docs/9.6/static/sql-copy.html</a></div><div> </div><div>Best 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" &lt;ashwani(dot)b(dot)kumar(at)ericsson(dot)com&gt;:</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(at)postgresql(dot)org">pgsql-admin-owner(at)postgresql(dot)org</a> [mailto:<a href="mailto:pgsql-admin-owner(at)postgresql(dot)org">pgsql-admin-owner(at)postgresql(dot)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(at)postgresql(dot)org">pgsql-admin(at)postgresql(dot)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>=&gt; <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 &lt;<a href="mailto:ashwani(dot)b(dot)kumar(at)ericsson(dot)com" target="_blank">ashwani(dot)b(dot)kumar(at)ericsson(dot)com</a>&gt;:</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>

Attachment Content-Type Size
unknown_filename text/html 3.1 KB

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Mahesh Jhala 2017-06-01 19:11:11 Can manual vacuuming conflict with auto vacuuming?
Previous Message Ashwani Kumar B 2017-05-31 07:55:26 Re: How to load data in psql DB