Hi, I got this error after I upgraded to 7.2.1
I found the document from the below link.
http://www.postgresql.org/idocs/index.php?datatype-character.html
which say "Prior to PostgreSQL 7.2, strings that were too long were
silently truncated, no error was raised."
does anyone know if there is a option to set it truncate the strings?
Thanks alot.
Frank
Frank Yip <frankyip@nasitron.com> writes:
> which say "Prior to PostgreSQL 7.2, strings that were too long were
> silently truncated, no error was raised."
> does anyone know if there is a option to set it truncate the strings?
No. But in 7.3 you can do something like
insert into foo values('your data here'::varchar(25));
An explicit coercion to varchar(n) will truncate the data without error.
An implicit coercion will raise an error. Yes, it's pretty bizarre,
but it's what the SQL spec says to do when you read it closely enough.
regards, tom lane
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера