Getting the encoding of a Postgres database

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

    Method 1:

    If you're already logged in to the db server, just copy and paste this.

    SHOW SERVER_ENCODING;
    

    Result:

      server_encoding 
    -----------------  
    UTF8
    

    For Client encoding :

     SHOW CLIENT_ENCODING;
    

    Method 2:

    Again if you are already logged in, use this to get the list based result

    \l 
    

提交回复
热议问题