fix prev link in docs

Started by Nathan Bossart13 days ago8 messageshackers
Jump to latest
#1Nathan Bossart
nathandbossart@gmail.com

Right now, if you go to the following page and click "Prev", it'll send you
to the middle of the previous chapter:

https://www.postgresql.org/docs/devel/bgworker.html

My research indicates that this might caused by a bug in libxml2, but
regardless, a minimal fix is to change the link generation code to use
[position()=last()] instead of [last()] in the predicate on the union of
reverse axes. Patch attached.

--
nathan

Attachments:

v1-0001-fix-prev-link-in-docs.patchtext/plain; charset=us-asciiDownload+1-2
#2Ayush Tiwari
ayushtiwari.slg01@gmail.com
In reply to: Nathan Bossart (#1)
Re: fix prev link in docs

Hi,

On Thu, 11 Jun 2026 at 00:46, Nathan Bossart <nathandbossart@gmail.com>
wrote:

Right now, if you go to the following page and click "Prev", it'll send you
to the middle of the previous chapter:

https://www.postgresql.org/docs/devel/bgworker.html

My research indicates that this might caused by a bug in libxml2, but
regardless, a minimal fix is to change the link generation code to use
[position()=last()] instead of [last()] in the predicate on the union of
reverse axes. Patch attached.

Thanks for the patch.

I tested it and with patch the Prev tab works fine towards 45.6.
(previous chapter's end)

Regards,
Ayush

#3Nathan Bossart
nathandbossart@gmail.com
In reply to: Ayush Tiwari (#2)
Re: fix prev link in docs

On Sat, Jun 13, 2026 at 02:14:26AM +0530, Ayush Tiwari wrote:

Thanks for the patch.

I tested it and with patch the Prev tab works fine towards 45.6.
(previous chapter's end)

Thanks for reviewing. Committed.

--
nathan

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Nathan Bossart (#3)
Re: fix prev link in docs

Nathan Bossart <nathandbossart@gmail.com> writes:

On Sat, Jun 13, 2026 at 02:14:26AM +0530, Ayush Tiwari wrote:

I tested it and with patch the Prev tab works fine towards 45.6.
(previous chapter's end)

Thanks for reviewing. Committed.

I noticed that building the HTML docs got really painfully slower
recently, and the reason seems to be this patch. If you look
at guaibasaurus' runtimes for instance:

https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=guaibasaurus&amp;dt=2026-06-15%2012%3A20%3A02

https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=guaibasaurus&amp;dt=2026-06-15%2020%3A20%3A02

the time for the "make-doc" step went from 00:46 right before
this patch to 3:39 right afterward. That's consistent with
what I'm seeing locally. I don't find that acceptable.

(Oddly, the time to make PDFs hasn't increased, per BF member
alabio.)

regards, tom lane

#5Nathan Bossart
nathandbossart@gmail.com
In reply to: Tom Lane (#4)
Re: fix prev link in docs

On Wed, Jun 17, 2026 at 01:40:07PM -0400, Tom Lane wrote:

I noticed that building the HTML docs got really painfully slower
recently, and the reason seems to be this patch. If you look
at guaibasaurus' runtimes for instance:

https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=guaibasaurus&amp;dt=2026-06-15%2012%3A20%3A02

https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=guaibasaurus&amp;dt=2026-06-15%2020%3A20%3A02

the time for the "make-doc" step went from 00:46 right before
this patch to 3:39 right afterward. That's consistent with
what I'm seeing locally. I don't find that acceptable.

Oh, interesting. I somehow hadn't noticed that in my testing. I had a
more invasive form of the patch that I think might improve matters.
Double-checking...

--
nathan

#6Nathan Bossart
nathandbossart@gmail.com
In reply to: Nathan Bossart (#5)
Re: fix prev link in docs

On Wed, Jun 17, 2026 at 12:47:04PM -0500, Nathan Bossart wrote:

Oh, interesting. I somehow hadn't noticed that in my testing. I had a
more invasive form of the patch that I think might improve matters.
Double-checking...

The attached should resolve the issue without regressing build time.

--
nathan

Attachments:

v2-0001-fix-prev-link-take-2.patchtext/plain; charset=us-asciiDownload+26-27
#7Tom Lane
tgl@sss.pgh.pa.us
In reply to: Nathan Bossart (#6)
Re: fix prev link in docs

Nathan Bossart <nathandbossart@gmail.com> writes:

The attached should resolve the issue without regressing build time.

Fixes the build-time problem for me, thanks!

(I didn't look at the output, except for the head page.)

regards, tom lane

#8Nathan Bossart
nathandbossart@gmail.com
In reply to: Tom Lane (#7)
Re: fix prev link in docs

On Wed, Jun 17, 2026 at 03:25:41PM -0400, Tom Lane wrote:

Fixes the build-time problem for me, thanks!

Committed.

--
nathan