Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wujd7-00055w-1N for pgsql-sql@arkaria.postgresql.org; Wed, 11 Jun 2014 14:35:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Wujd6-0004xO-HZ for pgsql-sql@arkaria.postgresql.org; Wed, 11 Jun 2014 14:35:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Wujd5-0004xG-TQ for pgsql-sql@postgresql.org; Wed, 11 Jun 2014 14:35:55 +0000 Received: from sam.nabble.com ([216.139.236.26]) by magus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1Wujd1-0005sp-O6 for pgsql-sql@postgresql.org; Wed, 11 Jun 2014 14:35:54 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1Wujcy-0007ou-Oz for pgsql-sql@postgresql.org; Wed, 11 Jun 2014 07:35:48 -0700 Date: Wed, 11 Jun 2014 07:35:48 -0700 (PDT) From: David G Johnston To: pgsql-sql@postgresql.org Message-ID: <1402497348563-5806834.post@n5.nabble.com> In-Reply-To: <1402493925433-5806825.post@n5.nabble.com> References: <1402480834884-5806798.post@n5.nabble.com> <1402493925433-5806825.post@n5.nabble.com> Subject: Re: need to pass the csv file name as value to the column file_id MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: 0.8 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org David G Johnston wrote > > kranthi wrote >> Hi All, >> I need to copy data from csv file, In that table I have one column as >> file_id. I need to pass the csv file name as value to the column file_id. >> Could please help on this. > Then the name of the CSV file has to be part of the content in the file. One other possibility is to create a temporary table with the appropriate default for the filename column. There really isn't any way for you to use programs, like sed/awk/perl, to add the data to the original file unless you use psql to perform the transfer (if that is even an option in this context). David J. -- View this message in context: http://postgresql.1045698.n5.nabble.com/need-to-pass-the-csv-file-name-as-value-to-the-column-file-id-tp5806798p5806834.html Sent from the PostgreSQL - sql mailing list archive at Nabble.com. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql