Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ev5Kh-0000kb-9j for pgsql-docs@arkaria.postgresql.org; Sun, 11 Mar 2018 18:04:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ev5Kg-0003iV-96 for pgsql-docs@arkaria.postgresql.org; Sun, 11 Mar 2018 18:04:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ev5Kg-0003iM-3V for pgsql-docs@lists.postgresql.org; Sun, 11 Mar 2018 18:04:30 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ev5Kd-0006qc-H3 for pgsql-docs@lists.postgresql.org; Sun, 11 Mar 2018 18:04:29 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w2BI4Nao031004; Sun, 11 Mar 2018 14:04:23 -0400 From: Tom Lane To: scott.ure@caseware.com cc: pgsql-docs@lists.postgresql.org Subject: Re: Documentation for numeric/decimal type does not say that precision can be specified without scale In-reply-to: <152079109713.1223.8866810403339629903@wrigleys.postgresql.org> References: <152079109713.1223.8866810403339629903@wrigleys.postgresql.org> Comments: In-reply-to =?utf-8?q?PG_Doc_comments_form?= message dated "Sun, 11 Mar 2018 17:58:17 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <31002.1520791463.1@sss.pgh.pa.us> Date: Sun, 11 Mar 2018 14:04:23 -0400 Message-ID: <31003.1520791463@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk =?utf-8?q?PG_Doc_comments_form?= writes: > The documentation for the numeric/decimal type does not say that the > precision parameter can be specified without specifying a scale, e.g. > numeric(10) is valid. Where are you looking exactly? What I see under 8.1.2 is Both the maximum precision and the maximum scale of a numeric column can be configured. To declare a column of type numeric use the syntax: NUMERIC(precision, scale) The precision must be positive, the scale zero or positive. Alternatively: NUMERIC(precision) selects a scale of 0. Specifying: NUMERIC without any precision or scale creates a column in which numeric values of any precision and scale can be stored, up to the implementation limit on precision. A column of this kind will not coerce input values to any particular scale, whereas numeric columns with a declared scale will coerce input values to that scale. (The SQL standard requires a default scale of 0, i.e., coercion to integer precision. We find this a bit useless. If you're concerned about portability, always specify the precision and scale explicitly.) regards, tom lane