How to specify a tab in a postgres front-end COPY

前端 未结 2 916
醉梦人生
醉梦人生 2020-12-22 21:42

I would like to use the psql \"\\copy\" command to pull data from a tab-delimited file into Postgres. I\'m using this command:

\\copy cm_state from \'state.         


        
相关标签:
2条回答
  • 2020-12-22 22:05

    Use E'\t' to tell postgresql there may be escaped characters in there:

    \copy cm_state from 'state.data' with delimiter E'\t' null as ;
    
    0 讨论(0)
  • 2020-12-22 22:07

    you can do this copy cm_state from stdin with (format 'text')

    0 讨论(0)
提交回复
热议问题