Re: New pg_lsn type doesn't have hash/btree opclasses - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: New pg_lsn type doesn't have hash/btree opclasses
Date
Msg-id CAB7nPqSxm-U0_+-YDMWtbNHq=MR+umWhA==Bg65dt+eOh0VGgQ@mail.gmail.com
Whole thread Raw
In response to Re: New pg_lsn type doesn't have hash/btree opclasses  (Andres Freund <andres@2ndquadrant.com>)
Responses Re: New pg_lsn type doesn't have hash/btree opclasses  (Fabrízio de Royes Mello <fabriziomello@gmail.com>)
List pgsql-hackers
On Wed, May 7, 2014 at 8:22 AM, Andres Freund <andres@2ndquadrant.com> wrote:
> Uh. They're different:
>
> Datum
> timestamp_hash(PG_FUNCTION_ARGS)
> {
>         /* We can use either hashint8 or hashfloat8 directly */
> #ifdef HAVE_INT64_TIMESTAMP
>         return hashint8(fcinfo);
> #else
>         return hashfloat8(fcinfo);
> #endif
> }
> note it's passing fcinfo, not the datum as you do. Same with
> time_hash.. In fact your version crashes when used because it's
> dereferencing a int8 as a pointer inside hashfloat8.
Thanks, didn't notice that fcinfo was used.
-- 
Michael



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: New pg_lsn type doesn't have hash/btree opclasses
Next
From: Andres Freund
Date:
Subject: Re: Wanted: jsonb on-disk representation documentation