开发者

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

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜