Re: [GENERAL] Why does increasing the precision of a numeric column rewrites the table?
В списке pgsql-general по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: [GENERAL] Why does increasing the precision of a numeric column rewrites the table? |
| Дата | |
| Msg-id | 8130.1507732221@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | [GENERAL] Why does increasing the precision of a numeric column rewrites thetable? (Thomas Kellerer <spam_eater@gmx.net>) |
| Список | pgsql-general |
Thomas Kellerer <spam_eater@gmx.net> writes:
> I don't understand why going from numeric(12,2) to numeric(15,3) would require a table rewrite.
The comment for numeric_transform explains this:
* Flatten calls to numeric's length coercion function that solely represent* increases in allowable precision. Scale
changesmutate every datum, so* they are unoptimizable. Some values, e.g. 1E-1001, can only fit into an* unconstrained
numeric,so a change from an unconstrained numeric to any* constrained numeric is also unoptimizable.
The issue is basically that changing '1.00' to '1.000' requires a change
in the actually-stored value.
regards, tom lane
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера