Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fpZWr-0001Lf-8B for pgsql-general@arkaria.postgresql.org; Tue, 14 Aug 2018 13:38:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fpZWp-0004Kf-J9 for pgsql-general@arkaria.postgresql.org; Tue, 14 Aug 2018 13:38:31 +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.89) (envelope-from ) id 1fpZWp-0004KY-7v for pgsql-general@lists.postgresql.org; Tue, 14 Aug 2018 13:38:31 +0000 Received: from n3.nabble.com ([162.255.23.22]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fpZWm-0001vf-GA for pgsql-general@postgresql.org; Tue, 14 Aug 2018 13:38:30 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id AF9FAE8CA510 for ; Tue, 14 Aug 2018 06:38:27 -0700 (MST) Date: Tue, 14 Aug 2018 06:38:27 -0700 (MST) From: pavan95 To: pgsql-general@postgresql.org Message-ID: <1534253907682-0.post@n3.nabble.com> In-Reply-To: <318228ff-6861-8a69-981f-48cb528a0dd9@aklaver.com> References: <1534252253597-0.post@n3.nabble.com> <318228ff-6861-8a69-981f-48cb528a0dd9@aklaver.com> Subject: Re: Copying data from a CSV file into a table dynamically MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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!! Thanks in Advance Regards, Pavan -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html