VARYING is not a standalone data type; it modifies CHAR, CHARACTER, or NCHAR to create a variable-length string type whose storage grows and shrinks with the actual data length up to a defined limit. The most common shorthand is VARCHAR, an ISO-standard synonym for CHARACTER VARYING. Unlike fixed-length CHAR(n), which always pads values to n characters, CHARACTER VARYING(n) stores only the supplied characters plus minimal overhead, improving storage efficiency and often query performance. If a length is omitted in some dialects, the column is treated as unlimited or defaults to a vendor-specific maximum. Attempting to insert a value longer than n results in an error or truncation, depending on the SQL mode and database settings. VARYING applies only to character types; there is no numeric or temporal equivalent. Because VARCHAR is more widely recognized, CHARACTER VARYING appears mainly in standards documents and highly portable code.
n
(integer) - Maximum number of characters allowed (required in most dialects, optional in PostgreSQL and Redshift)VARCHAR, CHAR, CHARACTER, TEXT, NCHAR, NVARCHAR, COLLATION, STRING_AGG
SQL-92 standard (as CHARACTER VARYING)
Yes. VARCHAR is a synonym defined by the SQL standard. Both declare variable-length character strings.
In most dialects yes, but PostgreSQL and Redshift allow omitting it, treating the field as unlimited or very large.
No for typical workloads. VARCHAR saves space and usually matches CHAR performance. CHAR may be marginally faster only when every stored value is exactly the fixed length.
By default they raise an error like "value too long for type character varying(n)". You can enable relaxed modes in some systems to auto-truncate, but this is discouraged.