I am still relatively new to pgSQL after switching away from mySQL completely.
I am trying to find the character limitations, if any, that pgSQL may or may not have. Specifically I am curious if there is a character limit on the following?
I've been searching Google, I've read the pgSQL FAQ, and a few random other posts but I haven't found a solid answer to any of these. Perhaps pgSQL does not have these limitations like mySQL does. If anyone could shed some light on this that would be great!
I am currently using pgSQL 9.3.1
In PostgreSQL, the text data type is used to keep the character of infinite length. And the text data type can hold a string with a maximum length of 65,535 bytes.
The notations varchar( n ) and char( n ) are aliases for character varying( n ) and character( n ) , respectively. character without length specifier is equivalent to character(1) . If character varying is used without length specifier, the type accepts strings of any size. The latter is a PostgreSQL extension.
Different from other database systems, in PostgreSQL, there is no performance difference among three character types. In most cases, you should use TEXT or VARCHAR . And you use the VARCHAR(n) when you want PostgreSQL to check for the length.
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
As username and database name are identifiers, that limit should apply to them.
I'm not aware of any length limitation on passwords (although I'm sure there is one).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With