Re: VARCHAR truncation

Поиск
Список
Период
Сортировка
Искать
От
David Wall
Тема
Re: VARCHAR truncation
Дата
Msg-id
arcc53$1vdd$1@news.hub.org
Список
Дерево обсуждения
Re: VARCHAR truncation "David Wall" <d.wall@computer.org>
Re: VARCHAR truncation Andrew Sullivan <andrew@libertyrms.info>
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 по дате отправления
От: David Wall
Дата:
Сообщение: VARCHAR truncation
От: Benjamin Stewart
Дата:
Сообщение: Stored Procedures
FAQ