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

From Andres Freund
Subject Re: [HACKERS] Hash Functions
Date
Msg-id 52778957-B778-415F-AEC1-CFD9F4842BCB@anarazel.de
Whole thread Raw
In response to Re: [HACKERS] Hash Functions  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: [HACKERS] Hash Functions
List pgsql-hackers

On May 13, 2017 8:44:22 PM PDT, Robert Haas <robertmhaas@gmail.com> wrote:
>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.

It'll be differently sized on different platforms.  So everyone will have to write hash functions that look at each
memberindividually, rather than hashing the entire struct at once.  And for each member you'll have to use a type
specifichash function... 

Andres
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [HACKERS] Hash Functions
Next
From: Andrew Dunstan
Date:
Subject: Re: [HACKERS] Latest Data::Dumper breaks hstore_plperl regressiontest