pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Daulat Ram <Daulat.Ram@exponential.com>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: bigint out of range
Date: Sun, 19 May 2019 09:54:22 -0400
Message-ID: <20190519135422.GF6197@tamriel.snowman.net> (raw)
In-Reply-To: <CAKFQuwbA+5nycp=GHyn3kfX++iv7TqAHLKxrywqosMjbKSUh1w@mail.gmail.com>
References: <BL0PR01MB518741644F902D8F4E447FF99B0A0@BL0PR01MB5187.prod.exchangelabs.com>
	<CAKFQuwbA+5nycp=GHyn3kfX++iv7TqAHLKxrywqosMjbKSUh1w@mail.gmail.com>

Greetings,

* David G. Johnston (david.g.johnston@gmail.com) wrote:
> On Thu, May 16, 2019 at 8:31 AM Daulat Ram <Daulat.Ram@exponential.com>
> wrote:
> 
> > url_hash        | bigint                  |           | not null |
> 
> 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

Attachments:

  signature.asc (application/pgp-signature, 818B) download

view thread (16+ messages)  latest in thread

Message-ID: <20190519135422.GF6197@tamriel.snowman.net>
Permalink:  ../20190519135422.GF6197@tamriel.snowman.net/
Also on:    postgresql.org/message-id/20190519135422.GF6197@tamriel.snowman.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: sfrost@snowman.net, david.g.johnston@gmail.com, Daulat.Ram@exponential.com
  Subject: Re: bigint out of range
  In-Reply-To: <20190519135422.GF6197@tamriel.snowman.net>
  References: <BL0PR01MB518741644F902D8F4E447FF99B0A0@BL0PR01MB5187.prod.exchangelabs.com> <CAKFQuwbA+5nycp=GHyn3kfX++iv7TqAHLKxrywqosMjbKSUh1w@mail.gmail.com> <20190519135422.GF6197@tamriel.snowman.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox