Re: New pg_lsn type doesn't have hash/btree opclasses

From: Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>, Craig Ringer <craig(at)2ndquadrant(dot)com>
Subject: Re: New pg_lsn type doesn't have hash/btree opclasses
Date: 2014-05-07 02:55:04
Message-ID: CAFcNs+qA+_xrB31VuSPCMfLfEk3PrOf1aTrpdu_RV6qx4sMPXg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, May 6, 2014 at 8:25 PM, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
wrote:
>
> On Wed, May 7, 2014 at 8:22 AM, Andres Freund <andres(at)2ndquadrant(dot)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.
>

Hi all,

If helps, I added some regression tests to the lastest patch.

Regards,

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
>> Timbira: http://www.timbira.com.br
>> Blog sobre TI: http://fabriziomello.blogspot.com
>> Perfil Linkedin: http://br.linkedin.com/in/fabriziomello
>> Twitter: http://twitter.com/fabriziomello

Attachment Content-Type Size
support-hash-btree-for-lsn.patch text/x-diff 10.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-05-07 03:08:12 Schizophrenic coding in gin_extract_jsonb(_hash)
Previous Message Peter Eisentraut 2014-05-07 02:20:19 Re: need xmllint on borka