public inbox for [email protected]
help / color / mirror / Atom feedFrom: Weck, Luis <[email protected]>
To: Marcelo Fernandes <[email protected]>
To: [email protected] <[email protected]>
Subject: Re: Increasing a NUMERIC column precision doesn't cause a table rewrite. Why?
Date: Mon, 3 Nov 2025 11:35:39 +0000
Message-ID: <IA3PR10MB8113ACB1FED522A1EC00FAF28DC7A@IA3PR10MB8113.namprd10.prod.outlook.com> (raw)
In-Reply-To: <CAM2F1VNniBN2RK9+DD8Pwz4tphE-1w3hZgtwZF-6c08--6JLiw@mail.gmail.com>
References: <CAM2F1VNniBN2RK9+DD8Pwz4tphE-1w3hZgtwZF-6c08--6JLiw@mail.gmail.com>
My understanding is that Postgres can guarantee that all the values in the table will fit the new precision without having to check. If you change the scale, it might be the case that some values won’t fit anymore, and Postgres must return an error. Numeric by itself is a variable length type, like TEXT (in a sense). That’s why we can modify its size without requiring a table rewrite at all!
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Increasing a NUMERIC column precision doesn't cause a table rewrite. Why?
In-Reply-To: <IA3PR10MB8113ACB1FED522A1EC00FAF28DC7A@IA3PR10MB8113.namprd10.prod.outlook.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox