Getting the encoding of a Postgres database

前端 未结 6 452
感情败类
感情败类 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:41

    A programmatic solution:

    SELECT pg_encoding_to_char(encoding) FROM pg_database WHERE datname = 'yourdb';
    

提交回复
热议问题