title: MySQL LOAD DATA INFILE with PostgreSQL COPY FROM command
body: <p>I am very new to PostgreSQL. Actually I was using MySQL before but for some project specific reason I need to use postgreSQL and do a POC.</p>
  
  <p>Now the problem is:
  I was using MySQL LOAD DATA INFILE command to load the column content from a file to my database table.</p>
  
  <p>My table structure is :
  Table name: MSISDN
  Table Column Names: ID(primary key - auto_generated), JOB_ID, MSISDN, REGION, STATUS</p>
  
  <p>But my input text file(rawBase.txt) is having only below columns:
  MSISDN, REGION</p>
  
  <p>so I was using the below command to load these above 2 column with initial JOB_ID and STATUS.</p>
  
  <pre><code>LOAD DATA INFILE 'D:\\project\\rawBase.txt' INTO TABLE MSISDN 
  FIELDS TERMINATED BY ',' 
  LINES TERMINATED BY '\n' 
  (MSISDN,REGION) 
  SET JOB_ID = 'XYZ1374147779999', STATUS = 0;
  </code></pre>
  
  <p>as you can see that there is a option available in LOAD DATA INFILE command where I can SET a particular initial value for the columns which are not present(JOB_ID and STATUS) in the input text file.</p>
  
  <p>NOW,</p>
  
  <p>in case of postgreSQL, I want same thing to happen.</p>
  
  <p>There is also a same kind of command available COPY FROM 
  like below:</p>
  
  <pre><code>COPY MSISDN FROM 'D:\\project\\rawBase.txt' WITH DELIMITER AS ','
  </code></pre>
  
  <p>but I am not able to SET a particular initial value for the rest columns which are not present(JOB_ID and STATUS) in my input text file. I am not getting any fruitful example of doing this.</p>
  
  <p>Please give some suggestion if possible.</p>
  
  <p>Regards,
  Sandy</p>