| От | Tom Lane |
|---|---|
| Тема | Re: error in the example given for numeric data types |
| Дата | |
| Msg-id | 3579168.1689427001@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: error in the example given for numeric data types (jian he <jian.universality@gmail.com>) |
| Список | pgsql-general |
jian he <jian.universality@gmail.com> writes: >> practice=# create table t1(height numeric(3,5)); >> ERROR: NUMERIC scale 5 must be between 0 and precision 3 > it works in pg15, not in pg14. > see my test: https://dbfiddle.uk/wgfjCx7j Indeed. The quoted documentation text is different between v15 and prior versions. Observe also the v15 release notes: https://www.postgresql.org/docs/15/release-15.html E.4.3.4. Data Types Allow the scale of a numeric value to be negative, or greater than its precision (Dean Rasheed, Tom Lane) This allows rounding of values to the left of the decimal point, e.g., '1234'::numeric(4, -2) returns 1200. regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера