CodePudding user response:
Varchar said receiving any string length, similar in pg and text types, the biggest store 1 gb of dataCodePudding user response:
https://www.postgresql.org/docs/current/datatype-character.htmlVarchar better performance:
Tip #
There is no performance difference among these three types, apart from increased storage space when using the blank - padded type, and what extra CPU cycles to check the length when storing into a length - constrained column. While character (n) has performance advantages in some other database systems, There is no to advantage in PostgreSQL. In fact character (n) is usually the slowest of the three because of its additional storage costs. In most situations the text or character varying should be 2 home.
CodePudding user response:
There is no performance difference between the three types, in addition to using blank filling type is to increase the storage space, and are stored in the length limit of column length adds some additional CPU cycles, although the character (n) in the other database system has performance advantages, but not in PostgreSQL this advantage; In fact, character (n) is usually the most slow in these three methods, because it needs additional storage costs, in most cases, you should use the text or character change,CodePudding user response:
Varchar (N) is not performance constraints to realize the significance of the largest function1. Constraints on data quality, such as id number field
2. To avoid a certain emotional instability programmer or user because of some kind of god on its technology operations, to the user table name column of each row inserted a "war and peace",