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 1hSMGn-0000nQ-F2 for pgsql-general@arkaria.postgresql.org; Sun, 19 May 2019 13:54:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hSMGk-0007fA-Sk for pgsql-general@arkaria.postgresql.org; Sun, 19 May 2019 13:54:30 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hSMGk-0007d4-EV for pgsql-general@lists.postgresql.org; Sun, 19 May 2019 13:54:30 +0000 Received: from tamriel.snowman.net ([2001:470:e38f::11]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hSMGd-0004YB-L4 for pgsql-general@lists.postgresql.org; Sun, 19 May 2019 13:54:28 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 050485F79F; Sun, 19 May 2019 09:54:22 -0400 (EDT) Date: Sun, 19 May 2019 09:54:22 -0400 From: Stephen Frost To: "David G. Johnston" Cc: Daulat Ram , "pgsql-general@lists.postgresql.org" Subject: Re: bigint out of range Message-ID: <20190519135422.GF6197@tamriel.snowman.net> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="muzbaVQ2bGU3ce2w" 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 --muzbaVQ2bGU3ce2w Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * David G. Johnston (david.g.johnston@gmail.com) wrote: > On Thu, May 16, 2019 at 8:31 AM Daulat Ram > wrote: >=20 > > url_hash | bigint | | not null | >=20 > Change the type of url_hash; make it text instead of bigint. Making it text wastes a bunch of space actually, since it's really a binary value. I tend to recommend using a bytea for storing hashes. Given that hashes are really fixed width, it'd be nice if we had a set of proper datatypes for them, perhaps not so much to avoid the 1-byte overhead from storing as a variable-length bytea, but because we could then avoid having a 7-byte hole due to padding if the hash is followed by a bigint or such. Thanks, Stephen --muzbaVQ2bGU3ce2w Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJc4WAOAAoJEO1sijiDR2RVVJQP/0nXgsKFCHamlafI9ao7Bl2q aMCnPqRL36UV8VRUoxFQUdhNXZYHYql/emqqRhQ9c/8VbDs90p1QZvCA7qulBPOh RMOfarm9KtYJzQIWJm6/HWcJmqgEeIYoEKUyfPNmCOoJCDTzwkIm7Ofx0/MSv+3b 5y5PPHjQHotbUekhnNVhNr49UHajV2ZjZTkCxlppBxsTpDho55MZMCydgEr3uh1c qmdCWt7G8qG+QdEZ2U7kr7VBxTPsn4bJsWrknehleLMMZEZGKoeRC+ZMpvu3ShI2 uTydbVdIa8kNyCCS93Jp4HWwQSqRMRIPohFQCUiQiAjz7nygOYVm42xPBnADRgDa iiGbKPFw6s50hauDdRkrVHcMuPD7yuoNGlBxYK4IJ+LdxsjweX5UrOmQ5FNblmPb 3Kw8K34/05Q0z/DJlbmDs5qoOE/rqRJMvkB487jA1U5GRUTBjTRbcveYyGXOMISK dlZzLW5fkjW2MnapAAdlI0xw+Q0vEfrQPLhB/37rIv0q4PHMxkoSpv1QwaXCrj/q 7zydvKaPGYIzLJjbwA+I7vn1nbE33qRjP4d0pszlC3mD6R2aUd0HO1PUUCENtAx+ 9mLh8gCuco4I3O5vy/wh0drUCVWg1V/QhbdpFc/2YLn2Cfd5+uajFODNzkPYb+RN QX6TFv8ikrV0shLHDk1+ =TnfE -----END PGP SIGNATURE----- --muzbaVQ2bGU3ce2w--