Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 2662D6366B1 for ; Thu, 4 Feb 2010 14:44:27 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 02379-04-6 for ; Thu, 4 Feb 2010 18:44:16 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-fx0-f220.google.com (mail-fx0-f220.google.com [209.85.220.220]) by mail.postgresql.org (Postfix) with ESMTP id 6A1B66343B8 for ; Thu, 4 Feb 2010 14:43:16 -0400 (AST) Received: by fxm20 with SMTP id 20so2934781fxm.21 for ; Thu, 04 Feb 2010 10:43:14 -0800 (PST) Received: by 10.223.76.65 with SMTP id b1mr1697978fak.5.1265308994718; Thu, 04 Feb 2010 10:43:14 -0800 (PST) Received: from ?192.168.0.73? (rrcs-64-183-7-130.west.biz.rr.com [64.183.7.130]) by mx.google.com with ESMTPS id 16sm216876fxm.4.2010.02.04.10.43.11 (version=SSLv3 cipher=RC4-MD5); Thu, 04 Feb 2010 10:43:13 -0800 (PST) Message-ID: <4B6B153D.9030200@emolecules.com> Date: Thu, 04 Feb 2010 10:43:09 -0800 From: Craig James User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Tory M Blue CC: pgsql-performance@postgresql.org Subject: Re: bigint integers up to 19 digits. References: <8a547c841002041015o57d533fdg7237c50dea7a9278@mail.gmail.com> In-Reply-To: <8a547c841002041015o57d533fdg7237c50dea7a9278@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.74 tagged_above=-10 required=5 tests=BAYES_20=-0.74 X-Spam-Level: X-Archive-Number: 201002/89 X-Sequence-Number: 37510 Tory M Blue wrote: > I have a column that is a bigint that needs to store integers up to 19 > digits long. For the most part this works but we sometimes have > numbers that are greater than 9223372036854775807. > ... > I was thinking of changing this to a real or double precision field, > but read in the docs that the value stored is not always the value > inserted... They're actually less precise than the same size of integer. Real/double datatypes trade more range for less precision in the same number of bytes. > My number will always be 19 digits long and always an integer. > I looked into the numeric data type, but the docs say that it can be slow. If it's *always* going to be 19 digits, couldn't you make it a text or char field? You didn't say if this is really a number. Do you do arithmetic with it? Sort it numerically? Or is it just a long identifier that happens to only used digits? Craig James