Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dG0et-0002Gd-OX for pgsql-admin@arkaria.postgresql.org; Wed, 31 May 2017 10:15:20 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dG0et-0006Na-1S for pgsql-admin@arkaria.postgresql.org; Wed, 31 May 2017 10:15:19 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dG0d5-00039I-GB for pgsql-admin@postgresql.org; Wed, 31 May 2017 10:13:27 +0000 Received: from forward5j.cmail.yandex.net ([5.255.227.23]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dG0d2-0003TA-2Z for pgsql-admin@postgresql.org; Wed, 31 May 2017 10:13:26 +0000 Received: from mxback3j.mail.yandex.net (mxback3j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10c]) by forward5j.cmail.yandex.net (Yandex) with ESMTP id 5C66020BEC; Wed, 31 May 2017 13:13:20 +0300 (MSK) Received: from web2j.yandex.ru (web2j.yandex.ru [5.45.198.43]) by mxback3j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id D1Y2nGiwiC-DJDu1Vt3; Wed, 31 May 2017 13:13:19 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=reddoc.net; s=mail; t=1496225599; bh=y8bLMoozT1BQXJAI1gZxL3YoRewssafwiIhmksY/CCA=; h=From:To:In-Reply-To:References:Subject:Message-Id:Date; b=W7BccJYJUwK2L2W2WSdTsKPynIAafE0R0xA634RgQm0Eqg+cr1bvuVZvt6Sh55NXy gqUEINAYptedeoyi0bfEYOrG2VbafLxlMPetFs1z77/nJRfAZ07OLn0dctM1mdhV5u 1XbCaDnp3PKu2o6UcWM5ePNgbaBqPWC3cwckfsQc= Authentication-Results: mxback3j.mail.yandex.net; dkim=pass header.i=@reddoc.net Received: by web2j.yandex.ru with HTTP; Wed, 31 May 2017 13:13:19 +0300 From: Samed YILDIRIM To: Ashwani Kumar B , Arnaud Gambonnet , "pgsql-admin@postgresql.org" In-Reply-To: References: Subject: Re: How to load data in psql DB MIME-Version: 1.0 Message-Id: <948971496225599@web2j.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Wed, 31 May 2017 13:13:19 +0300 Content-Transfer-Encoding: 8bit Content-Type: text/html; charset=utf-8 X-Pg-Spam-Score: -0.9 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org
Hi Ashwani,
 
You can use COPY command and psql to load CSV file to PostgreSQL.
 
\copy zip_codes FROM '/path/to/csv/ZIP_CODES.txt' DELIMITER ',' CSV
 
If you create a simple cronjob, it will periodically load your datas from CSV.
 
https://stackoverflow.com/questions/2987433/how-to-import-csv-file-data-into-a-postgresql-table
 
Best regards.
 
 


İyi çalışmalar.
Samed YILDIRIM



31.05.2017, 10:57, "Ashwani Kumar B" <ashwani.b.kumar@ericsson.com>:

Hi

 

It will be helpful if you share  any sample script which works in crontab and also sample of control file.

 

Regards

Ashwani

 

From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Arnaud Gambonnet
Sent: Wednesday, May 31, 2017 1:03 PM
To: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] How to load data in psql DB

 

Hi,

 

pgloader should fit your need.

 

 

Regards,

AG.

 

2017-05-31 8:30 GMT+02:00 Ashwani Kumar B <ashwani.b.kumar@ericsson.com>:

Hi

 

My requirement is to automatically load data which is in CSV format to psql DB table.

 

Normally in oracle I use to do it through sql-loader [sqlldr] . Do we have anything similar in psql.

 

Regards

Ashwani