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

Lists: pgsql-hackers
From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: pgsql-hackers(at)postgresql(dot)org, Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Craig Ringer <craig(at)2ndquadrant(dot)com>
Subject: New pg_lsn type doesn't have hash/btree opclasses
Date: 2014-05-06 07:14:32
Message-ID: 20140506071432.GM17909@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

Craig just mentioned in an internal chat that there's no btree or even
hash opclass for the new pg_lsn type. That restricts what you can do
with it quite severely.
Imo this should be fixed for 9.4 - after all it was possible unto now to
index a table with lsns returned by system functions or have queries
with grouping on them without casting.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: 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-06 13:37:54
Message-ID: 16583.1399383474@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> Craig just mentioned in an internal chat that there's no btree or even
> hash opclass for the new pg_lsn type. That restricts what you can do
> with it quite severely.
> Imo this should be fixed for 9.4 - after all it was possible unto now to
> index a table with lsns returned by system functions or have queries
> with grouping on them without casting.

Sorry, it is *way* too late for 9.4.

regards, tom lane


From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: 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-06 13:44:59
Message-ID: 20140506134459.GA5658@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 2014-05-06 09:37:54 -0400, Tom Lane wrote:
> Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> > Craig just mentioned in an internal chat that there's no btree or even
> > hash opclass for the new pg_lsn type. That restricts what you can do
> > with it quite severely.
> > Imo this should be fixed for 9.4 - after all it was possible unto now to
> > index a table with lsns returned by system functions or have queries
> > with grouping on them without casting.
>
> Sorry, it is *way* too late for 9.4.

It's imo a regression/oversight introduced in the pg_lsn patch. Not a
new feature.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: 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-06 13:49:07
Message-ID: CAB7nPqSNgr4OQQOGkONtmNBM+ybE1YzBm5TPEd6j=PJcM=jUkw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, May 6, 2014 at 4:14 PM, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
> Hi,
>
> Craig just mentioned in an internal chat that there's no btree or even
> hash opclass for the new pg_lsn type. That restricts what you can do
> with it quite severely.
> Imo this should be fixed for 9.4 - after all it was possible unto now to
> index a table with lsns returned by system functions or have queries
> with grouping on them without casting.
Makes sense, especially knowing operators needed for btree processing
are already defined. Patch attached solves that. Now to include it in
9.4 where development is over is another story... I wouldn't mind
adding it to the next commit fest either.
Regards,
--
Michael

Attachment Content-Type Size
20140506_pglsn_btree_hash.patch text/plain 6.5 KB

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: 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-06 14:17:39
Message-ID: 17433.1399385859@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> On 2014-05-06 09:37:54 -0400, Tom Lane wrote:
>> Sorry, it is *way* too late for 9.4.

> It's imo a regression/oversight introduced in the pg_lsn patch. Not a
> new feature.

You can argue that if you like, but it doesn't matter. It's too late for
a change as big as that for such an inessential feature. We are in the
stabilization game at this point, and adding features is not the thing to
be doing.

Especially not features for which no patch even exists. I don't care if
it could be done in a few hours by copy-and-paste, it would still be the
very definition of rushed coding. We're past the window for this kind of
change in 9.4.

regards, tom lane


From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: 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-06 14:59:43
Message-ID: 5368F8DF.30809@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 05/06/2014 05:17 PM, Tom Lane wrote:
> Andres Freund <andres(at)2ndquadrant(dot)com> writes:
>> On 2014-05-06 09:37:54 -0400, Tom Lane wrote:
>>> Sorry, it is *way* too late for 9.4.
>
>> It's imo a regression/oversight introduced in the pg_lsn patch. Not a
>> new feature.
>
> You can argue that if you like, but it doesn't matter. It's too late for
> a change as big as that for such an inessential feature. We are in the
> stabilization game at this point, and adding features is not the thing to
> be doing.

FWIW, I agree with Andres that this would be a reasonable thing to add.
Exactly the kind of oversight that we should be fixing at this stage in
the release cycle.

- Heikki


From: Vik Fearing <vik(dot)fearing(at)dalibo(dot)com>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: 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-06 15:19:56
Message-ID: 5368FD9C.1060407@dalibo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 05/06/2014 04:59 PM, Heikki Linnakangas wrote:
> On 05/06/2014 05:17 PM, Tom Lane wrote:
>> Andres Freund <andres(at)2ndquadrant(dot)com> writes:
>>> On 2014-05-06 09:37:54 -0400, Tom Lane wrote:
>>>> Sorry, it is *way* too late for 9.4.
>>
>>> It's imo a regression/oversight introduced in the pg_lsn patch. Not a
>>> new feature.
>>
>> You can argue that if you like, but it doesn't matter. It's too late
>> for
>> a change as big as that for such an inessential feature. We are in the
>> stabilization game at this point, and adding features is not the
>> thing to
>> be doing.
>
> FWIW, I agree with Andres that this would be a reasonable thing to
> add. Exactly the kind of oversight that we should be fixing at this
> stage in the release cycle.

I agree as well.

--
Vik


From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: 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-06 23:03:50
Message-ID: CAB7nPqSuGNztUvhPbKuo4V1k=o5Fsq6GjBr39TN3Kd0m8r1cPQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, May 6, 2014 at 10:49 PM, Michael Paquier
<michael(dot)paquier(at)gmail(dot)com> wrote:
> Makes sense, especially knowing operators needed for btree processing
> are already defined. Patch attached solves that.
Please find attached an updated patch, I completely forgot that the
compare function needs to return {-1, 0, 1}.
--
Michael

Attachment Content-Type Size
20140507_pglsn_btree_hash_v2.patch text/plain 6.2 KB

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: 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-06 23:07:22
Message-ID: 20140506230722.GE24808@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

On 2014-05-06 22:49:07 +0900, Michael Paquier wrote:
> Makes sense, especially knowing operators needed for btree processing
> are already defined. Patch attached solves that.

Thanks for doing that quickly.

FWIW, the format you're using makes applying the patch including the
commit message relatively hard. Consider using git format-patch.

> +/* handler for btree index operator */
> +Datum
> +pg_lsn_cmp(PG_FUNCTION_ARGS)
> +{
> + XLogRecPtr lsn1 = PG_GETARG_LSN(0);
> + XLogRecPtr lsn2 = PG_GETARG_LSN(1);
> +
> + PG_RETURN_INT32(lsn1 == lsn2);
> +}

This doesn't look correct. A cmp routine needs to return -1, 0, 1 when a
< b, a = b, a > b respectively. You'll only return 0 and 1 here.

> +/* hash index support */
> +Datum
> +pg_lsn_hash(PG_FUNCTION_ARGS)
> +{
> + XLogRecPtr lsn = PG_GETARG_LSN(0);
> +
> + return hashint8(lsn);
> +}

That can't be right either. There's at least two things wrong here:
a) hashint8 takes PG_FUNCTION_ARGS, not a Datum
b) you're not including the necessary header defining hashint8.

I've used

SELECT DISTINCT (g.i||'/0')::pg_lsn f FROM generate_series(1, 100) g(i), generate_series(1, 5);
SELECT (g.i||'/0')::pg_lsn f FROM generate_series(1, 100) g(i) ORDER BY f;
SELECT (g.i||'/0')::pg_lsn, count(*) FROM generate_series(1, 100) g(i), generate_series(1, 5) GROUP BY 1 ORDER BY 1;
SELECT * FROM
(SELECT (g.i||'/0')::pg_lsn lsn FROM generate_series(1, 10) g(i) ORDER BY g.i) a
JOIN (SELECT (g.i||'/0')::pg_lsn lsn FROM generate_series(1, 10) g(i) ORDER BY g.i DESC) b
ON (a.lsn = b.lsn );

To check that a) hashing works, b) sorting works, c) mergesorts works
after fixing the above issues. New version of the patch attached

I completely agree with Heikki's point that this kind of oversight is
the actual reason for a beta period.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachment Content-Type Size
0001-Support-for-hash-and-btree-operators-for-pg_lsn-data.patch text/x-patch 7.1 KB

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: 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-06 23:16:38
Message-ID: CAB7nPqRWprhP0BpaN3-3ER1AZ1s6yjryx=kb28TRkLQj2yff9w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, May 7, 2014 at 8:07 AM, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
> On 2014-05-06 22:49:07 +0900, Michael Paquier wrote:
> FWIW, the format you're using makes applying the patch including the
> commit message relatively hard. Consider using git format-patch.
Could you be clearer? By applying a filterdiff command or by using git
diff? The latter has been used for this patch.

>> +/* handler for btree index operator */
>> +Datum
>> +pg_lsn_cmp(PG_FUNCTION_ARGS)
>> +{
>> + XLogRecPtr lsn1 = PG_GETARG_LSN(0);
>> + XLogRecPtr lsn2 = PG_GETARG_LSN(1);
>> +
>> + PG_RETURN_INT32(lsn1 == lsn2);
>> +}
>
> This doesn't look correct. A cmp routine needs to return -1, 0, 1 when a
> < b, a = b, a > b respectively. You'll only return 0 and 1 here.
Thanks, I recalled that this morning as well... And my 2nd patch uses
this flow instead:
+Datum
+pg_lsn_cmp(PG_FUNCTION_ARGS)
+{
+ XLogRecPtr lsn1 = PG_GETARG_LSN(0);
+ XLogRecPtr lsn2 = PG_GETARG_LSN(1);
+
+ if (lsn1 < lsn2)
+ PG_RETURN_INT32(-1);
+ if (lsn1 > lsn2)
+ PG_RETURN_INT32(1);
+ PG_RETURN_INT32(0);
+}

>> +/* hash index support */
>> +Datum
>> +pg_lsn_hash(PG_FUNCTION_ARGS)
>> +{
>> + XLogRecPtr lsn = PG_GETARG_LSN(0);
>> +
>> + return hashint8(lsn);
>> +}
>
> That can't be right either. There's at least two things wrong here:
> a) hashint8 takes PG_FUNCTION_ARGS, not a Datum
In this case you may consider changing timestamp_hash(at)time(dot)c and
time_hash(at)date(dot)c as well :)
--
Michael


From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: 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-06 23:22:53
Message-ID: 20140506232253.GB555@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 2014-05-07 08:16:38 +0900, Michael Paquier wrote:
> On Wed, May 7, 2014 at 8:07 AM, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
> > On 2014-05-06 22:49:07 +0900, Michael Paquier wrote:
> > FWIW, the format you're using makes applying the patch including the
> > commit message relatively hard. Consider using git format-patch.

> Could you be clearer? By applying a filterdiff command or by using git
> diff? The latter has been used for this patch.

As I said, consider using git format-patch. Then the patch can be
applied using git am. Resulting in a local commit including your
commit message.

> >> +/* handler for btree index operator */
> >> +Datum
> >> +pg_lsn_cmp(PG_FUNCTION_ARGS)
> >> +{
> >> + XLogRecPtr lsn1 = PG_GETARG_LSN(0);
> >> + XLogRecPtr lsn2 = PG_GETARG_LSN(1);
> >> +
> >> + PG_RETURN_INT32(lsn1 == lsn2);
> >> +}
> >
> > This doesn't look correct. A cmp routine needs to return -1, 0, 1 when a
> > < b, a = b, a > b respectively. You'll only return 0 and 1 here.
> Thanks, I recalled that this morning as well... And my 2nd patch uses
> this flow instead:
> +Datum
> +pg_lsn_cmp(PG_FUNCTION_ARGS)
> +{
> + XLogRecPtr lsn1 = PG_GETARG_LSN(0);
> + XLogRecPtr lsn2 = PG_GETARG_LSN(1);
> +
> + if (lsn1 < lsn2)
> + PG_RETURN_INT32(-1);
> + if (lsn1 > lsn2)
> + PG_RETURN_INT32(1);
> + PG_RETURN_INT32(0);
> +}

That's nearly what's in the patch I attached.

> >> +/* hash index support */
> >> +Datum
> >> +pg_lsn_hash(PG_FUNCTION_ARGS)
> >> +{
> >> + XLogRecPtr lsn = PG_GETARG_LSN(0);
> >> +
> >> + return hashint8(lsn);
> >> +}
> >
> > That can't be right either. There's at least two things wrong here:
> > a) hashint8 takes PG_FUNCTION_ARGS, not a Datum

> In this case you may consider changing timestamp_hash(at)time(dot)c and
> time_hash(at)date(dot)c as well :)

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.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: 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-06 23:25:19
Message-ID: CAB7nPqSxm-U0_+-YDMWtbNHq=MR+umWhA==Bg65dt+eOh0VGgQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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.
--
Michael


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
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

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: New pg_lsn type doesn't have hash/btree opclasses
Date: 2014-05-07 04:21:05
Message-ID: 5369B4B1.50306@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 05/07/2014 07:16 AM, Michael Paquier wrote:
> On Wed, May 7, 2014 at 8:07 AM, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
>> On 2014-05-06 22:49:07 +0900, Michael Paquier wrote:
>> FWIW, the format you're using makes applying the patch including the
>> commit message relatively hard. Consider using git format-patch.

> Could you be clearer? By applying a filterdiff command or by using git
> diff? The latter has been used for this patch.

git format-patch -1

is usually what you want to emit a patch for the top commit. To produce
a patchset between the current branch and master:

git format-patch master

It doesn't use context diff, but I think people here have mostly stopped
caring about that now (?).

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Craig Ringer <craig(at)2ndquadrant(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>
Subject: Re: New pg_lsn type doesn't have hash/btree opclasses
Date: 2014-05-07 06:27:54
Message-ID: CAB7nPqStrxb3xxBRHzURnTJMu2bBiWuwpqg06hWHxNXv-+kM=g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, May 7, 2014 at 1:21 PM, Craig Ringer <craig(at)2ndquadrant(dot)com> wrote:
> On 05/07/2014 07:16 AM, Michael Paquier wrote:
>> On Wed, May 7, 2014 at 8:07 AM, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
>>> On 2014-05-06 22:49:07 +0900, Michael Paquier wrote:
>>> FWIW, the format you're using makes applying the patch including the
>>> commit message relatively hard. Consider using git format-patch.
>
>> Could you be clearer? By applying a filterdiff command or by using git
>> diff? The latter has been used for this patch.
>
> git format-patch -1
>
> is usually what you want to emit a patch for the top commit. To produce
> a patchset between the current branch and master:
>
> git format-patch master
>
> It doesn't use context diff, but I think people here have mostly stopped
> caring about that now (?).
Thanks for the details, I didn't know this subcommand of git.
--
Michael


From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(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-08 13:49:07
Message-ID: 20140508134907.GB27830@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

On 2014-05-06 23:55:04 -0300, Fabrízio de Royes Mello wrote:
> If helps, I added some regression tests to the lastest patch.

I think we should apply this patch now. It's much more sensible with the
opclasses present and we don't win anything by waiting for 9.5.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Fabrízio Mello <fabriziomello(at)gmail(dot)com>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, 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-09 13:01:07
Message-ID: CAHGQGwFmnDSaYqfhVCGuqpxNUoHMtDOtiPCdbGLdUA92A0F9_Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, May 7, 2014 at 11:55 AM, Fabrízio de Royes Mello
<fabriziomello(at)gmail(dot)com> wrote:
>
> 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.

+DATA(insert OID = 3260 ( 403 pglsn_ops PGNSP PGUID ));
+DATA(insert OID = 3261 ( 405 pglsn_ops PGNSP PGUID ));

The patch looks good to me except the name of index operator class.
I think that "pg_lsn_ops" is better than "pglsn_ops" because it's for "pg_lsn"
data type.

Regards,

--
Fujii Masao


From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Fabrízio Mello <fabriziomello(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(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-09 13:03:36
Message-ID: 20140509130336.GC30231@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 2014-05-09 22:01:07 +0900, Fujii Masao wrote:
> On Wed, May 7, 2014 at 11:55 AM, Fabrízio de Royes Mello
> <fabriziomello(at)gmail(dot)com> wrote:
> >
> > 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.
>
> +DATA(insert OID = 3260 ( 403 pglsn_ops PGNSP PGUID ));
> +DATA(insert OID = 3261 ( 405 pglsn_ops PGNSP PGUID ));
>
> The patch looks good to me except the name of index operator class.

FWIW, I've tested and looked through the patch as well.

> I think that "pg_lsn_ops" is better than "pglsn_ops" because it's for "pg_lsn"
> data type.

You're right, that's marginally prettier.

You plan to commit it?

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Fabrízio Mello <fabriziomello(at)gmail(dot)com>, 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-09 13:14:25
Message-ID: CAB7nPqT-TuPOBWUgFmkTemSY0fDgtvK4s+zmp-h6ee9Z9e+FKg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, May 9, 2014 at 10:01 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> +DATA(insert OID = 3260 ( 403 pglsn_ops PGNSP PGUID ));
> +DATA(insert OID = 3261 ( 405 pglsn_ops PGNSP PGUID ));
>
> The patch looks good to me except the name of index operator class.
> I think that "pg_lsn_ops" is better than "pglsn_ops" because it's for "pg_lsn"
> data type.
Well, yes... Btw, before doing anything with this patch, I think that
the version of Fabrizio could be used as a base, but the regression
tests should be reshuffled a bit...
--
Michael


From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Fabrízio Mello <fabriziomello(at)gmail(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-09 13:18:18
Message-ID: 20140509131817.GE30231@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 2014-05-09 22:14:25 +0900, Michael Paquier wrote:
> On Fri, May 9, 2014 at 10:01 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> > +DATA(insert OID = 3260 ( 403 pglsn_ops PGNSP PGUID ));
> > +DATA(insert OID = 3261 ( 405 pglsn_ops PGNSP PGUID ));
> >
> > The patch looks good to me except the name of index operator class.
> > I think that "pg_lsn_ops" is better than "pglsn_ops" because it's for "pg_lsn"
> > data type.
> Well, yes... Btw, before doing anything with this patch, I think that
> the version of Fabrizio could be used as a base, but the regression
> tests should be reshuffled a bit...

I honestly don't really see much point in the added tests. If at all I'd
rather see my tests from
http://archives.postgresql.org/message-id/20140506230722.GE24808%40awork2.anarazel.de
addded. With some EXPLAIN (COSTS OFF) they'd test more.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Fabrízio Mello <fabriziomello(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(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-09 13:49:45
Message-ID: CAHGQGwEosPfvSy6Y8D5+ALj9Y245tgRQvKfz+CYEr++ZAHrS8Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, May 9, 2014 at 10:03 PM, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
> On 2014-05-09 22:01:07 +0900, Fujii Masao wrote:
>> On Wed, May 7, 2014 at 11:55 AM, Fabrízio de Royes Mello
>> <fabriziomello(at)gmail(dot)com> wrote:
>> >
>> > 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.
>>
>> +DATA(insert OID = 3260 ( 403 pglsn_ops PGNSP PGUID ));
>> +DATA(insert OID = 3261 ( 405 pglsn_ops PGNSP PGUID ));
>>
>> The patch looks good to me except the name of index operator class.
>
> FWIW, I've tested and looked through the patch as well.
>
>> I think that "pg_lsn_ops" is better than "pglsn_ops" because it's for "pg_lsn"
>> data type.
>
> You're right, that's marginally prettier.
>
> You plan to commit it?

Yes unless many people object the commit.

Michael,
You're now modifying the patch?

Regards,

--
Fujii Masao


From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, Fabrízio Mello <fabriziomello(at)gmail(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-09 23:37:43
Message-ID: CAB7nPqRHUMSQWOyEViPGzcm2B7fREqJKucZugTU6+azxY4cAgA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, May 9, 2014 at 10:49 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> Yes unless many people object the commit.
>
> Michael,
> You're now modifying the patch?
Not within a couple of days.
--
Michael


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, Fabrízio Mello <fabriziomello(at)gmail(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-09 23:42:39
Message-ID: 10449.1399678959@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Michael Paquier <michael(dot)paquier(at)gmail(dot)com> writes:
> On Fri, May 9, 2014 at 10:49 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>> Yes unless many people object the commit.
>>
>> Michael,
>> You're now modifying the patch?
> Not within a couple of days.

I think it's really too late for this for 9.4. At this point it's
less than 48 hours until beta1 wraps, and we do not have the bandwidth
to do anything but worry about stabilizing the features we've already
got.

regards, tom lane


From: Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(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-09 23:57:58
Message-ID: CAFcNs+o2oUKfa5Vy=HX=TBOLUb5mjoAjrhT7x-F4R3G6r1zZhw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, May 9, 2014 at 10:18 AM, Andres Freund <andres(at)2ndquadrant(dot)com>
wrote:
>
> On 2014-05-09 22:14:25 +0900, Michael Paquier wrote:
> > On Fri, May 9, 2014 at 10:01 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
wrote:
> > > +DATA(insert OID = 3260 ( 403 pglsn_ops PGNSP PGUID
));
> > > +DATA(insert OID = 3261 ( 405 pglsn_ops PGNSP PGUID
));
> > >
> > > The patch looks good to me except the name of index operator class.
> > > I think that "pg_lsn_ops" is better than "pglsn_ops" because it's for
"pg_lsn"
> > > data type.
> > Well, yes... Btw, before doing anything with this patch, I think that
> > the version of Fabrizio could be used as a base, but the regression
> > tests should be reshuffled a bit...
>
> I honestly don't really see much point in the added tests. If at all I'd
> rather see my tests from
>
http://archives.postgresql.org/message-id/20140506230722.GE24808%40awork2.anarazel.de
> addded. With some EXPLAIN (COSTS OFF) they'd test more.
>

Ok. In a few hours I'll add your suggestion and send it again.

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


From: Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, 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-10 00:01:05
Message-ID: CAFcNs+qgR0LmVu8Y-jnQcZOxVeutTu_BOL-TKo-QJcZe0v4zGA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, May 9, 2014 at 8:42 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Michael Paquier <michael(dot)paquier(at)gmail(dot)com> writes:
> > On Fri, May 9, 2014 at 10:49 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
wrote:
> >> Yes unless many people object the commit.
> >>
> >> Michael,
> >> You're now modifying the patch?
> > Not within a couple of days.
>
> I think it's really too late for this for 9.4. At this point it's
> less than 48 hours until beta1 wraps, and we do not have the bandwidth
> to do anything but worry about stabilizing the features we've already
> got.
>

But it's a very small change with many benefits, and Michael acted very
proactive to make this happens.

In a few hours I'll fix the last two suggestions (Fujii and Andres) and
send it again.

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


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: fabriziomello(at)gmail(dot)com
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, 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-10 00:30:09
Message-ID: 11527.1399681809@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

=?UTF-8?Q?Fabr=C3=ADzio_de_Royes_Mello?= <fabriziomello(at)gmail(dot)com> writes:
> On Fri, May 9, 2014 at 8:42 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> I think it's really too late for this for 9.4. At this point it's
>> less than 48 hours until beta1 wraps, and we do not have the bandwidth
>> to do anything but worry about stabilizing the features we've already
>> got.

> But it's a very small change with many benefits, and Michael acted very
> proactive to make this happens.

[ shrug... ] "proactive" would have been doing this a month ago.
If we're going to ship a release, we have to stop taking new features
at some point, and we are really past that point for 9.4.

And, to be blunt, this is not important enough to hold up the release
for, nor to take any stability risks for. It should go into the next
commitfest cycle where it can get a non-rushed review.

regards, tom lane


From: Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, 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-10 00:51:28
Message-ID: CAFcNs+pMViL+X1kF3pumc2Cp+e1jUoGBDMyZ+SE0PLRR9tmAWw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, May 9, 2014 at 9:30 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> =?UTF-8?Q?Fabr=C3=ADzio_de_Royes_Mello?= <fabriziomello(at)gmail(dot)com> writes:
> > On Fri, May 9, 2014 at 8:42 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >> I think it's really too late for this for 9.4. At this point it's
> >> less than 48 hours until beta1 wraps, and we do not have the bandwidth
> >> to do anything but worry about stabilizing the features we've already
> >> got.
>
> > But it's a very small change with many benefits, and Michael acted very
> > proactive to make this happens.
>
> [ shrug... ] "proactive" would have been doing this a month ago.
> If we're going to ship a release, we have to stop taking new features
> at some point, and we are really past that point for 9.4.
>
> And, to be blunt, this is not important enough to hold up the release
> for, nor to take any stability risks for. It should go into the next
> commitfest cycle where it can get a non-rushed review.
>

I agree with you that is too late to add *new features*.

But I agree with Andres when he said this is a regression introcuced in the
pg_lsn patch.

So we'll release a version that break a simple query like that:

fabrizio=# SELECT DISTINCT (g.i||'/0')::pg_lsn f FROM generate_series(1,
100) g(i), generate_series(1, 5);
ERROR: could not identify an equality operator for type pg_lsn
LINE 1: SELECT DISTINCT (g.i||'/0')::pg_lsn f FROM generate_series(1...
^

I attached the last version of this fix with the Andres and Fujii
suggestions.

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_v2.patch text/x-patch 13.4 KB

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, Fabrízio Mello <fabriziomello(at)gmail(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-10 05:43:39
Message-ID: CAB7nPqSgZVrHRgsgUg63SCFY+AwH-=3JuDy7moq-_fo7Wi4++Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, May 9, 2014 at 10:49 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> On Fri, May 9, 2014 at 10:03 PM, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
>> You plan to commit it?
>
> Yes unless many people object the commit.
>
> Michael, you're now modifying the patch?
OK, I have been able to put my head into that earlier than I thought
as it would be better to get that done before the beta, finishing with
the attached. When hacking that, I noticed that some tests were
missing for some of the operators. I am including them in this patch
as well, with more tests for unique index creation, ordering, and
hash/btree index creation. The test suite looks cleaner with all that.
--
Michael

Attachment Content-Type Size
0001-Add-hash-btree-operators-for-pg_lsn.patch text/plain 13.6 KB

From: Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, 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-10 12:45:30
Message-ID: CAFcNs+paF3O4tJ470kXf-Csog2Fr-eW3nz_yWxFcO9hDbMbZ0Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sat, May 10, 2014 at 2:43 AM, Michael Paquier
<michael(dot)paquier(at)gmail(dot)com>wrote:

> On Fri, May 9, 2014 at 10:49 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
> wrote:
> > On Fri, May 9, 2014 at 10:03 PM, Andres Freund <andres(at)2ndquadrant(dot)com>
> wrote:
> >> You plan to commit it?
> >
> > Yes unless many people object the commit.
> >
> > Michael, you're now modifying the patch?
> OK, I have been able to put my head into that earlier than I thought
> as it would be better to get that done before the beta, finishing with
> the attached. When hacking that, I noticed that some tests were
> missing for some of the operators. I am including them in this patch
> as well, with more tests for unique index creation, ordering, and
> hash/btree index creation. The test suite looks cleaner with all that.
>
>
Last night I sent a patch [1] to add more tests and change the operator
name. Maybe we can merge the test cases... ;-)

Regards,

[1]
http://www.postgresql.org/message-id/CAFcNs+pMViL+X1kF3pumc2Cp+e1jUoGBDMyZ+SE0PLRR9tmAWw@mail.gmail.com

--
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


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Fabrízio Mello <fabriziomello(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, 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-10 21:02:23
Message-ID: CAHGQGwEAoChnqAsHSM7SGtroAw7WZQa3295W7pUYoE4_ZTdNRA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sat, May 10, 2014 at 9:51 AM, Fabrízio de Royes Mello
<fabriziomello(at)gmail(dot)com> wrote:
>
> On Fri, May 9, 2014 at 9:30 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>
>> =?UTF-8?Q?Fabr=C3=ADzio_de_Royes_Mello?= <fabriziomello(at)gmail(dot)com> writes:
>> > On Fri, May 9, 2014 at 8:42 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> >> I think it's really too late for this for 9.4. At this point it's
>> >> less than 48 hours until beta1 wraps, and we do not have the bandwidth
>> >> to do anything but worry about stabilizing the features we've already
>> >> got.
>>
>> > But it's a very small change with many benefits, and Michael acted very
>> > proactive to make this happens.
>>
>> [ shrug... ] "proactive" would have been doing this a month ago.
>> If we're going to ship a release, we have to stop taking new features
>> at some point, and we are really past that point for 9.4.
>>
>> And, to be blunt, this is not important enough to hold up the release
>> for, nor to take any stability risks for. It should go into the next
>> commitfest cycle where it can get a non-rushed review.
>>
>
> I agree with you that is too late to add *new features*.
>
> But I agree with Andres when he said this is a regression introcuced in the
> pg_lsn patch.
>
> So we'll release a version that break a simple query like that:
>
> fabrizio=# SELECT DISTINCT (g.i||'/0')::pg_lsn f FROM generate_series(1,
> 100) g(i), generate_series(1, 5);
> ERROR: could not identify an equality operator for type pg_lsn
> LINE 1: SELECT DISTINCT (g.i||'/0')::pg_lsn f FROM generate_series(1...
> ^

I agree that this is not new feature but just the fix of oversight of
the pg_lsn patch.
Without such opclass, we cannot execute even such simple query.

Regards,

--
Fujii Masao


From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Fabrízio Mello <fabriziomello(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Michael Paquier <michael(dot)paquier(at)gmail(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-10 21:17:39
Message-ID: 20140510211739.GC16507@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 2014-05-11 06:02:23 +0900, Fujii Masao wrote:
> On Sat, May 10, 2014 at 9:51 AM, Fabrízio de Royes Mello
> <fabriziomello(at)gmail(dot)com> wrote:
> >
> > On Fri, May 9, 2014 at 9:30 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >> [ shrug... ] "proactive" would have been doing this a month ago.
> >> If we're going to ship a release, we have to stop taking new features
> >> at some point, and we are really past that point for 9.4.

We *couldn't* do it a month ago since we didn't know about it a month
ago. My delorean is getting a bit old.

> > I agree with you that is too late to add *new features*.
> >
> > But I agree with Andres when he said this is a regression introcuced in the
> > pg_lsn patch.
> >
> > So we'll release a version that break a simple query like that:
> >
> > fabrizio=# SELECT DISTINCT (g.i||'/0')::pg_lsn f FROM generate_series(1,
> > 100) g(i), generate_series(1, 5);
> > ERROR: could not identify an equality operator for type pg_lsn
> > LINE 1: SELECT DISTINCT (g.i||'/0')::pg_lsn f FROM generate_series(1...
> > ^
>
> I agree that this is not new feature but just the fix of oversight of
> the pg_lsn patch.
> Without such opclass, we cannot execute even such simple query.

I don't even understand why it's questionable whether this should be
fixed. It's an almost trivial patch for an oversight in a newly
introduced feature. We gain absolutely nothing by patching this in the
next cycle, except that things need to be tested twice.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Fabrízio Mello <fabriziomello(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(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-10 21:52:19
Message-ID: 20513.1399758739@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> I don't even understand why it's questionable whether this should be
> fixed.

Sigh. We have some debate isomorphic to this one every year, it seems
like. The argument why it shouldn't be fixed now is: ITS. TOO. LATE.
Which part of that isn't clear to you?

Or, if you think that this feature is so important that we should slip
the beta schedule to get it in, we can take a vote on that. But at
this point any slip means no beta till after PGCon.

regards, tom lane


From: Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(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-10 22:19:22
Message-ID: CAFcNs+qgB+OLrrkuMqwR0=Egfj1hyXNFKs2Qg5-MDrLNEkayRg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sat, May 10, 2014 at 6:52 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> > I don't even understand why it's questionable whether this should be
> > fixed.
>
> Sigh. We have some debate isomorphic to this one every year, it seems
> like. The argument why it shouldn't be fixed now is: ITS. TOO. LATE.
> Which part of that isn't clear to you?
>

Sorry but I don't understand why it's too late. The 9.4 branch not been
created yet.

And in the last hours various patches (mostly fixes) have been committed
and IMO this is not different.

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


From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(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-10 22:27:13
Message-ID: 20140510222713.GF16507@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 2014-05-10 19:19:22 -0300, Fabrízio de Royes Mello wrote:
> On Sat, May 10, 2014 at 6:52 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >
> > Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> > > I don't even understand why it's questionable whether this should be
> > > fixed.
> >
> > Sigh. We have some debate isomorphic to this one every year, it seems
> > like. The argument why it shouldn't be fixed now is: ITS. TOO. LATE.
> > Which part of that isn't clear to you?
> >
>
> Sorry but I don't understand why it's too late. The 9.4 branch not been
> created yet.

The problem is that once the beta is in progress (starting tomorrow),
the projects tries to avoid changes which require a dump and restore (or
pg_upgrade). Since the patch changes the catalog it'd require that.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(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-10 22:31:09
Message-ID: CABUevEx7Tw21hK5VgSc5CpDOxAtofbzocjSHUDb2iA9VHPD1Rw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sun, May 11, 2014 at 12:27 AM, Andres Freund <andres(at)2ndquadrant(dot)com>wrote:

> On 2014-05-10 19:19:22 -0300, Fabrízio de Royes Mello wrote:
> > On Sat, May 10, 2014 at 6:52 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > >
> > > Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> > > > I don't even understand why it's questionable whether this should be
> > > > fixed.
> > >
> > > Sigh. We have some debate isomorphic to this one every year, it seems
> > > like. The argument why it shouldn't be fixed now is: ITS. TOO. LATE.
> > > Which part of that isn't clear to you?
> > >
> >
> > Sorry but I don't understand why it's too late. The 9.4 branch not been
> > created yet.
>
> The problem is that once the beta is in progress (starting tomorrow),
> the projects tries to avoid changes which require a dump and restore (or
> pg_upgrade). Since the patch changes the catalog it'd require that.
>
>
It would be pg_upgrade'able though, wouldn't it? Don't we have precedents
for requiring pg_upgrade during beta? At least that's a smaller problem
than requiring a complete dump/reload.

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(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-10 22:34:51
Message-ID: 21585.1399761291@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> On 2014-05-10 19:19:22 -0300, Fabrzio de Royes Mello wrote:
>> Sorry but I don't understand why it's too late. The 9.4 branch not been
>> created yet.

> The problem is that once the beta is in progress (starting tomorrow),
> the projects tries to avoid changes which require a dump and restore (or
> pg_upgrade). Since the patch changes the catalog it'd require that.

Exactly. If this isn't in before beta1, it's not going in, unless perhaps
we encounter some bug bad enough to force an initdb later in beta.
Which is certainly possible, and if it did happen there might be room
to reconsider. But the same policy means there is zero margin for error
with a catalog-changing patch applied right before beta starts, which
is what we're debating here.

As a comparison point, in a nearby thread we're debating renaming
jsonb_hash_ops, which is a sufficiently mechanical change that I'd
not be too afraid to do it the day before beta. But there are enough
ways to screw up a new operator class that I'm very afraid of putting
one in this weekend.

regards, tom lane


From: Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(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-10 22:37:17
Message-ID: CAFcNs+rA3d2ZBZw0O3qN9KvZwG6xZ+33tqiQT_j4brr9LDezXw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sat, May 10, 2014 at 7:27 PM, Andres Freund <andres(at)2ndquadrant(dot)com>
wrote:
>
> On 2014-05-10 19:19:22 -0300, Fabrízio de Royes Mello wrote:
> > On Sat, May 10, 2014 at 6:52 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > >
> > > Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> > > > I don't even understand why it's questionable whether this should be
> > > > fixed.
> > >
> > > Sigh. We have some debate isomorphic to this one every year, it seems
> > > like. The argument why it shouldn't be fixed now is: ITS. TOO. LATE.
> > > Which part of that isn't clear to you?
> > >
> >
> > Sorry but I don't understand why it's too late. The 9.4 branch not been
> > created yet.
>
> The problem is that once the beta is in progress (starting tomorrow),
> the projects tries to avoid changes which require a dump and restore (or
> pg_upgrade). Since the patch changes the catalog it'd require that.
>

Hmmmm... so the other option maybe is create an extension to add this
operators.

Thoughts?

--
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


From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(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-10 22:39:44
Message-ID: 20140510223944.GG16507@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 2014-05-11 00:31:09 +0200, Magnus Hagander wrote:
> On Sun, May 11, 2014 at 12:27 AM, Andres Freund <andres(at)2ndquadrant(dot)com>wrote:
>
> > On 2014-05-10 19:19:22 -0300, Fabrízio de Royes Mello wrote:
> > > On Sat, May 10, 2014 at 6:52 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > > >
> > > > Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> > > > > I don't even understand why it's questionable whether this should be
> > > > > fixed.
> > > >
> > > > Sigh. We have some debate isomorphic to this one every year, it seems
> > > > like. The argument why it shouldn't be fixed now is: ITS. TOO. LATE.
> > > > Which part of that isn't clear to you?
> > > >
> > >
> > > Sorry but I don't understand why it's too late. The 9.4 branch not been
> > > created yet.
> >
> > The problem is that once the beta is in progress (starting tomorrow),
> > the projects tries to avoid changes which require a dump and restore (or
> > pg_upgrade). Since the patch changes the catalog it'd require that.
> >
> >
> It would be pg_upgrade'able though, wouldn't it?

Yes.

> Don't we have precedents
> for requiring pg_upgrade during beta? At least that's a smaller problem
> than requiring a complete dump/reload.

I think in reality there's been catversion updates after most of the
recent beta1 releases.

9.3 (one):
git log 817a89423f429a6a8b36847ee499f5b6be39c3be.. -- src/include/catalog/catversion.h
9.2 (one, but reverted):
git log f70fa835e08eee4cb2dc0f72d66cf633089c37e8..REL9_2_0 -- src/include/catalog/catversion.h
9.1 (two):
git log 993c5e59047dd568d4831f7ec5c6199acd21f17f..REL9_1_0 -- src/include/catalog/catversion.h
9.0 (one)
git log -p f9d9b2b34a094b94fda39231c16ab5f2e6bfbbe4..REL9_0_0 -- src/include/catalog/catversion.h

(makes me really wish betas were properly tagged with git as well...)

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Fujii Masao <masao(dot)fujii(at)gmail(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-10 22:45:20
Message-ID: CAB7nPqSOV09hrUPjO7n7ZjOsM3+Mr5OgN_NVBOX0P4mmYPntsQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sun, May 11, 2014 at 7:39 AM, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
> (makes me really wish betas were properly tagged with git as well...)
They are tags for betas, here is for example the update of CATVERSION for 9.3:
$ git log -p REL9_3_BETA1..REL9_3_0 src/include/catalog/catversion.h |
grep commit
commit dc3eb5638349e74a6628130a5101ce866455f4a3
--
Michael


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(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-10 23:08:48
Message-ID: 22548.1399763328@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Magnus Hagander <magnus(at)hagander(dot)net> writes:
> On Sun, May 11, 2014 at 12:27 AM, Andres Freund <andres(at)2ndquadrant(dot)com>wrote:
>> The problem is that once the beta is in progress (starting tomorrow),
>> the projects tries to avoid changes which require a dump and restore (or
>> pg_upgrade). Since the patch changes the catalog it'd require that.

> It would be pg_upgrade'able though, wouldn't it? Don't we have precedents
> for requiring pg_upgrade during beta? At least that's a smaller problem
> than requiring a complete dump/reload.

pg_upgrade makes the penalty for screwups smaller, but a post-beta1 initdb
is still the result of a screwup. None of the historical examples you
mention were planned in advance of beta.

regards, tom lane


From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(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-10 23:17:13
Message-ID: 20140510231713.GH16507@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 2014-05-10 19:08:48 -0400, Tom Lane wrote:
> Magnus Hagander <magnus(at)hagander(dot)net> writes:
> > On Sun, May 11, 2014 at 12:27 AM, Andres Freund <andres(at)2ndquadrant(dot)com>wrote:
> >> The problem is that once the beta is in progress (starting tomorrow),
> >> the projects tries to avoid changes which require a dump and restore (or
> >> pg_upgrade). Since the patch changes the catalog it'd require that.
>
> > It would be pg_upgrade'able though, wouldn't it? Don't we have precedents
> > for requiring pg_upgrade during beta? At least that's a smaller problem
> > than requiring a complete dump/reload.
>
> pg_upgrade makes the penalty for screwups smaller, but a post-beta1 initdb
> is still the result of a screwup. None of the historical examples you
> mention were planned in advance of beta.

Yea, I posted that just to answer Magnus' question.

I've argued that this omission should be fixed since tuesday. There's
been a tested and reviewed patch since
20140506230722(dot)GE24808(at)awork2(dot)anarazel(dot)de(dot) Given how many changes went
in since it certainly wouldn't have been a very destabilizing commit.

Anyway. I accept it's too late for beta1 now. Let's commit it if there's
another catversion bump.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: fabriziomello(at)gmail(dot)com
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, 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-10 23:23:05
Message-ID: CAB7nPqQwWwCCUCCOjOLjU1zNEUMpQ-CQvN9kPhZ8S4vWNvYnrA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sat, May 10, 2014 at 9:45 PM, Fabrízio de Royes Mello
<fabriziomello(at)gmail(dot)com> wrote:
> Last night I sent a patch [1] to add more tests and change the operator
> name. Maybe we can merge the test cases... ;-)
Sure, I noticed that. But I think that they are more complicated than
necessary. I am as well doubtful about adding test cases with EXPLAIN
for a data type test suite.

The patch introduces two new things: pg_lsn_cmp and pg_lsn_hash. To
test the former a simple ORDER BY query is enough as cmp is used as an
ordering operator. And for the latter creating a hash index looks
enough as it tests using the hash function when inserting index
tuples. Not to mention as well that the tests are more readable.
Regards,
--
Michael


From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Magnus Hagander <magnus(at)hagander(dot)net>, Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(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-10 23:24:57
Message-ID: CAB7nPqQ2-MbwG9QfHSRUebwxCp4u2i0iaqxtUKRU+QFgY-ux4A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sun, May 11, 2014 at 8:17 AM, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
> Anyway. I accept it's too late for beta1 now. Let's commit it if there's
> another catversion bump.
+1. Let's rely on the experience of senior committers here.
--
Michael


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Fabrízio Mello <fabriziomello(at)gmail(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-06-05 00:54:38
Message-ID: 25024.1401929678@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> On 2014-05-09 22:14:25 +0900, Michael Paquier wrote:
>> [ patch ]

I've committed a revised version of Andres' patch. Mostly cosmetic
fixes, but the hash implementation was still wrong:

return DirectFunctionCall1(hashint8, PG_GETARG_LSN(0));

DirectFunctionCallN takes Datums, not de-Datumified values. This coding
would've crashed on 32-bit machines, where hashint8 would be expecting
to receive a Datum containing a pointer to int64.

We could have done it correctly like this:

return DirectFunctionCall1(hashint8, PG_GETARG_DATUM(0));

but I thought it was better, and microscopically more efficient, to
follow the existing precedent in timestamp_hash:

return hashint8(fcinfo);

since that avoids an extra FunctionCallInfoData setup.

>> On Fri, May 9, 2014 at 10:01 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>>> The patch looks good to me except the name of index operator class.
>>> I think that "pg_lsn_ops" is better than "pglsn_ops" because it's for "pg_lsn"
>>> data type.

I concur, and changed this.

> I honestly don't really see much point in the added tests. If at all I'd
> rather see my tests from
> http://archives.postgresql.org/message-id/20140506230722.GE24808%40awork2.anarazel.de
> addded. With some EXPLAIN (COSTS OFF) they'd test more.

I thought even that was kind of overkill; but a bigger problem is the
output was sensitive to hash values which are not portable across
different architectures. With a bit of experimentation I found that
a SELECT DISTINCT ... ORDER BY query would exercise both hashing and
sorting, so that's what got committed. (I'm not entirely sure though
whether the plan will be stable across architectures; we might have
to tweak the test case based on buildfarm feedback.)

regards, tom lane


From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Fabrízio Mello <fabriziomello(at)gmail(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-06-05 02:07:33
Message-ID: CAB7nPqTFzWC34JU4MtQMJj6jKDX9tZ-bnH_A44HNxa8twVhh1w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Jun 5, 2014 at 9:54 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Andres Freund <andres(at)2ndquadrant(dot)com> writes:
>> On 2014-05-09 22:14:25 +0900, Michael Paquier wrote:
>>> [ patch ]
>
> I've committed a revised version of Andres' patch.
Thanks!

> I thought even that was kind of overkill; but a bigger problem is the
> output was sensitive to hash values which are not portable across
> different architectures. With a bit of experimentation I found that
> a SELECT DISTINCT ... ORDER BY query would exercise both hashing and
> sorting, so that's what got committed. (I'm not entirely sure though
> whether the plan will be stable across architectures; we might have
> to tweak the test case based on buildfarm feedback.)
Yeah this was a bit too much, and came up with some more light-weight
regression tests instead in the patch here:
http://www.postgresql.org/message-id/CAB7nPqSgZVrHRgsgUg63SCFY+AwH-=3JuDy7moq-_fo7Wi4++Q@mail.gmail.com
--
Michael