Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hLpEj-0002Ju-CE for pgsql-general@arkaria.postgresql.org; Wed, 01 May 2019 13:25:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hLpEg-00072s-VE for pgsql-general@arkaria.postgresql.org; Wed, 01 May 2019 13:25:22 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1hLpEg-00072l-Lu for pgsql-general@lists.postgresql.org; Wed, 01 May 2019 13:25:22 +0000 Received: from tamriel.snowman.net ([96.255.250.162]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hLpEe-0005Vk-3Y for pgsql-general@lists.postgresql.org; Wed, 01 May 2019 13:25:22 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 692385F79F; Wed, 1 May 2019 09:25:18 -0400 (EDT) Date: Wed, 1 May 2019 09:25:18 -0400 From: Stephen Frost To: Charlin Barak Cc: pgsql-general@lists.postgresql.org Subject: Re: Oracle number to PostgreSQL Message-ID: <20190501132518.GC6197@tamriel.snowman.net> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="J4eAGbPG+DpTKllK" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --J4eAGbPG+DpTKllK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Charlin Barak (charlinbarak@gmail.com) wrote: > When migrating from Oracle number(10,3) to PostgreSQL, is numeric(10,3) > ideal or should I consider some other data types? This really depends on what data is actually in that field and if you need it to be exact. If the field actually contains integers and always will, then using an integer type field is *much* more efficient, either 'integer' if the values will always be less than 2B, or 'bigint' if it'll be larger. If the field actually contains floating point and can be inexact, then using 'real' or 'float8' will be more efficient than numeric. If the field needs to be exact (eg: monetary fields), then using numeric(10,3) is correct. I strongly recommend considering the data that goes into the field when making this decision- there really is no 'one size fits all' when going =66rom number to numeric. Thanks, Stephen --J4eAGbPG+DpTKllK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJcyZ4+AAoJEO1sijiDR2RVxOwP/0fHrPIeiVmtegm1uYWOed/2 RdSkTO9u2aetbRMFuWy8kXqqaoftBza/BZpVCUdSZv1k3Zy51IPGrk+UUdBiyOiA 6ZXxhi45UxTUJQuCpirymlAgeiDqIWr92/0oxx+Hnw8ZYPIL8FBU/zkqEdcD4H2i CJLZVDc4Kg6tJGfie7trk4M2Ejf0+YchuGMRbp6PEzosbFhX3RlH2mdcW91Sdq31 GS1iqm8x+x9XXZ9ZZYRpWwwMiYnUtP4iFOO5Sl50iIZTugrb1yunvr1kol0kDB3t eMSEwF5W+GKGwS7Ka6RVAdEbFtNiBO4eDlGzIj6aaj9oFlHT4xR5alKaywra0+d7 46qvljce59QIVm429SguJkdD9/SbcYS9h0vUrjoKNy/G6QPfZRs0fe28dCpoi9R6 JwCaONWxcxfI8rqFprMEmyCWVIkyXbH0ymlt4NxLrtKvK95FQLjRiK7R2NJxbna9 RHoPr0hYmUcvUKLpKOQIiXTKLuCTT/sjQQE8+Dtg49+tZQlUu8MMyCHLKuMMTSki pLwcf4u9rj02L5rKLQSZB5XwdYzqfefwylM2QjBfiykxvNuuZ/SkIRsV8pSERWgc StwrD2FLKew57CXyanc+DHTdFCHZFUozSqGF9dlsEcP72AQPx9IdXn5eI9EAyk51 ByNeBZNONXLuPGB+boVf =alHX -----END PGP SIGNATURE----- --J4eAGbPG+DpTKllK--