Re: bigint out of range - Mailing list pgsql-general

From Stephen Frost
Subject Re: bigint out of range
Date
Msg-id 20190519135422.GF6197@tamriel.snowman.net
Whole thread Raw
In response to Re: bigint out of range  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general
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

Attachment

pgsql-general by date:

Previous
From: Ron
Date:
Subject: Re: bigint out of range
Next
From: Stephen Frost
Date:
Subject: Re: bigint out of range