How do I stop Postgres copy command to stop padding Strings?
My field is defined as follows
"COLUMNNAME" character(9)
I import CSV files using the following command
copy "TABLE" from '/my/directory' DELIMITERS ',' CSV;
If I have a string such as 'ABCDEF' Postgres pads it out to 'ABCDEF   '.  How can I stop it from 开发者_开发知识库doing this?
it is because you have char instead of varchar. change type of your column into varchar and everything will be fine
 
         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论