Re: need to pass the csv file name as value to the column file_id - Mailing list pgsql-sql

From David G Johnston
Subject Re: need to pass the csv file name as value to the column file_id
Date
Msg-id 1402497348563-5806834.post@n5.nabble.com
Whole thread Raw
In response to Re: need to pass the csv file name as value to the column file_id  (David G Johnston <david.g.johnston@gmail.com>)
List pgsql-sql
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.



pgsql-sql by date:

Previous
From: David G Johnston
Date:
Subject: Re: need to pass the csv file name as value to the column file_id
Next
From: David G Johnston
Date:
Subject: Re: need to pass the csv file name as value to the column file_id