From 221af6caa6e0e4b3b8c1fe1b8457cbbed6d493ac Mon Sep 17 00:00:00 2001 From: Aditya Toshniwal Date: Wed, 11 Oct 2023 15:06:13 +0530 Subject: [PATCH] Fix an issue where scale in columns is not allowed to have value as 0 or below. #6851 --- docs/en_US/release_notes_7_8.rst | 1 + .../databases/schemas/tables/columns/static/js/column.ui.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/en_US/release_notes_7_8.rst b/docs/en_US/release_notes_7_8.rst index 6410f5c33..27e1da077 100644 --- a/docs/en_US/release_notes_7_8.rst +++ b/docs/en_US/release_notes_7_8.rst @@ -44,3 +44,4 @@ Bug fixes | `Issue #6790 `_ - Ensure that the backup works properly for PG 16 on the latest docker image. | `Issue #6799 `_ - Fixed an issue where the user is unable to select objects on the backup dialog due to tree flickering. | `Issue #6836 `_ - Fixed an issue where non-super PostgreSQL users are not able to terminate their own connections from dashboard. + | `Issue #6851 `_ - Fix an issue where scale in columns is not allowed to have value as 0 or below. \ No newline at end of file diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/static/js/column.ui.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/static/js/column.ui.js index 34398d8ff..f006206e7 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/static/js/column.ui.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/static/js/column.ui.js @@ -143,7 +143,8 @@ export default class ColumnSchema extends BaseUISchema { attprecisionRange(state) { for(let o of this.datatypes) { if ( state.cltype == o.value ) { - if(o.precision) return {min: o.min_val || 0, max: o.max_val}; + // PostgreSQL allows negative precision + if(o.precision) return {min: -o.max_val, max: o.max_val}; } } return null;