Help Center/ GaussDB/ Developer Guide(Distributed_V2.0-8.x)/ SQL Reference/ Character Sets and Collations/ Character Sets and Collations of the Client Connection
Updated on 2025-05-29 GMT+08:00

Character Sets and Collations of the Client Connection

When data containing character set attributes is transmitted between the server and client, encoding conversion is automatically performed. After receiving an SQL statement from a client, the server converts the character set of the SQL statement from the client character set client_encoding to the database character set server_encoding. Before the query result data is sent to the client, the data is encoded and converted to the client_encoding character set of the client.

System parameters:

  • server_encoding

    Character set specified during database creation. For details, see CREATE DATABASE.

  • client_encoding

    Character set of the client, which can be modified using the SET NAMES statement. For details, see SET.

  • character_set_connection

    Default character set of string constants for which no character sets are specified in SQL statements.

  • collation_connection

    Default collation of string constants for which no collations are specified in SQL statements.

  • character_set_results

    Character set of the returned result.

    • For an expression that converts a non-character type object to a character type, the result character set and collation are character_set_connection and collation_connection, respectively.

    • By default, the character set and collation number of a bound parameter of the character type are the values of character_set_connection and collation_connection, respectively.

    • During character data conversion, the character encoding is verified. If the character encoding does not meet the requirements, an error message is displayed.