Re: VARCHAR truncation
От | David Wall |
---|---|
Тема | Re: VARCHAR truncation |
Дата | |
Msg-id | arcc53$1vdd$1@news.hub.org обсуждение исходный текст |
Ответ на | VARCHAR truncation ("David Wall" <d.wall@computer.org>) |
Ответы |
Re: VARCHAR truncation
|
Список | pgsql-general |
From the docs, I read: +++ SQL defines two primary character types: character(n) and character varying(n), where n is a positive integer. 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, 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.) If the string to be stored is shorter than the declared length, values of type character will be space-padded; values of type character varying will simply store the shorter string. Note: Prior to PostgreSQL 7.2, strings that were too long were silently truncated, no error was raised. +++ This is the "problem" that I've run into since we recently moved from 7.1 to 7.2. Is there any way to get the non-standard behavior back? David
В списке pgsql-general по дате отправления: