Is there any difference between varchar and varchar(n) regarding any performance and disk usage in postgresql? (Except length constraint and constraint performance). For example, does varchar(wihtout n) consume more space?
Asked
Active
Viewed 145 times
0
-
1https://www.postgresql.org/docs/current/datatype-character.html - read the green tip. – Abelisto Nov 16 '20 at 11:37
1 Answers
0
varchar
, varchar(n)
and text
are all the same under the hood; the only exception is the lenght check in varchar(n)
, which acts like a (fast) check constraint.

Laurenz Albe
- 209,280
- 17
- 206
- 263