开发者

How do I stop Postgres copy command to stop padding Strings?

开发者 https://www.devze.com 2023-03-26 15:07 出处:网络
My field is defined as follows \"COLUMNNAME\" character(9) I import CSV files using the following command

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

0

精彩评论

暂无评论...
验证码 换一张
取 消