Getting the encoding of a Postgres database

前端 未结 6 533
感情败类
感情败类 2021-01-30 09:57

I have a database, and I need to know the default encoding for the database. I want to get it from the command line.

6条回答
  •  天命终不由人
    2021-01-30 10:31

    From the command line:

    psql my_database -c 'SHOW SERVER_ENCODING'
    

    From within psql, an SQL IDE or an API:

    SHOW SERVER_ENCODING
    

提交回复
热议问题