Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.9.3/8.9.3) with ESMTP id MAA96689 for ; Sun, 16 Jan 2000 12:35:44 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id MAA20838; Sun, 16 Jan 2000 12:35:34 -0500 (EST) To: Peter Eisentraut cc: Mitch Vincent , pgsql-sql@postgreSQL.org Subject: Re: [SQL] numeric question.. In-reply-to: References: Comments: In-reply-to Peter Eisentraut message dated "Sun, 16 Jan 2000 18:14:04 +0100" Date: Sun, 16 Jan 2000 12:35:34 -0500 Message-ID: <20835.948044134@sss.pgh.pa.us> From: Tom Lane Peter Eisentraut writes: > NUMERIC specifies the data type exact numeric, with the decimal precision > and scale specified by the and . > DECIMAL specifies the data type exact numeric, with the decimal scale > specified by the and the implementation-defined decimal precision > equal to or greater than the value of the specified . > Up to this day I'm wondering what exactly this means ... Yeah, I read that too. I think what it means is that implementors are allowed to increase the precision (field width) of a DECIMAL field to a larger value if that's more efficient in their implementation, whereas NUMERIC must have exactly the specified precision. For example, if we were to reimplement NUMERIC using radix-10000 arithmetic (four decimal digits per 16-bit integer), then the most efficient field widths would be multiples of 4. According to the spec, we'd be allowed to increase the field width of a DECIMAL field to make it a multiple of 4, but not the width of a NUMERIC field. Right now, there is no such implementation advantage in Postgres, so the two field types are exactly equivalent in our code. regards, tom lane