|
|
|
|
|
by masklinn
1749 days ago
|
|
> I believe that Postgres, following the SQL standard, silently truncates longer strings when using varchar(n) AFAIK Postgres has always triggered an error in that case, though it was apparently not documented in 7.1 here is the documentation from 7.2: > Both of these types can store strings up to n characters in length. An attempt to store a longer string into a column of these types will result in an error What you may be referring to is the following note: > unless the excess characters are all spaces, in which case the string will be truncated to the maximum length. (This somewhat bizarre exception is required by the SQL standard.) So the SQL standard requires silently stripping (truncating spaces) from the end until the value fits or no more spaces can be truncated. |
|