PgSQL Character Restrictions

I'm still relatively new to pgSQL after completely disconnecting from mySQL.

I am trying to find character restrictions, if any, that pgSQL may or may not have. In particular, I am wondering if there is a restriction on the following characters?

  • Database Name Length (mySQL - 64 characters)
  • Username Length (mySQL - 16 characters)
  • Password length

I searched Google, I read the pgSQL FAQ and a few other random posts, but I did not find a reliable answer to any of them. Perhaps pgSQL does not have such limitations as mySQL. If anyone could shed light on this, that would be great!

I am currently using pgSQL 9.3.1

+6
source share
1 answer

The length for any identifier is limited to 63 characters:

http://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS

By default, NAMEDATALEN is 64, so the maximum identifier length is 63 bytes

Since the username and database name are identifiers, this limit should apply to them.

I do not know the length limits on passwords (although I am sure there is one).

+9
source

Source: https://habr.com/ru/post/956422/


All Articles