Re: [HACKERS] Hash Functions - Mailing list pgsql-hackers

From Robert Haas
Subject Re: [HACKERS] Hash Functions
Date
Msg-id CA+TgmoZZJD2OviFo48yTgU+90dfHSVg5RpGcPC5i3D5Wsem5yg@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Hash Functions  (Andres Freund <andres@anarazel.de>)
Responses Re: [HACKERS] Hash Functions  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On Sat, May 13, 2017 at 7:08 PM, Andres Freund <andres@anarazel.de> wrote:
> I seriously doubt that's true.  A lot of more complex types have
> internal alignment padding and such.

True, but I believe we require those padding bytes to be zero.  If we
didn't, then hstore_hash would be broken already.

> Consider e.g. something like
> jsonb, hstore, or postgis types - you *can* convert them to something
> that's unambiguous, but it's going to be fairly expensive.

I'm fuzzy on what you think we'd need to do.

> Essentially
> you'd have to something like calling the output function, and then
> hashing the result of that.

I really don't see why we'd have to go to nearly that length.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Re: [HACKERS] Latest Data::Dumper breaks hstore_plperl regression test
Next
From: Andres Freund
Date:
Subject: Re: [HACKERS] Hash Functions