Re: Improve This Sentence?

2020-04-24 Thread Michael Paquier
On Mon, Apr 13, 2020 at 05:54:26AM -0400, Dave Cramer wrote:
> Ironically the first one above is supposed to be providing more clarity if
> you can believe:
> For additional information on tuning these settings, see Section 29.4.
> 
> Clearly just copying the text from 19.5.2 to 29.4 is an improvement. I'd be
> somewhat loathe to be that repetitive but honestly I don't have a better
> suggestion

Duplication is not good in my opinion, as updating one section may
cause the other to become outdated.  As the performance issues are
mainly discussed in wal.sgml, why not moving the performance arguments
in the description of checkpoint_flush_after in config.sgml to
wal.sgml, and adding a link in config.sgml back to wal-configuration?
--
Michael


signature.asc
Description: PGP signature


Re: Documentation: 21.5. Default Roles

2020-04-24 Thread Jonathan S. Katz
On 4/9/20 11:45 PM, Bruce Momjian wrote:
> On Thu, Apr  9, 2020 at 08:47:56PM -0400, Jonathan Katz wrote:
>> On 4/9/20 4:57 PM, Bruce Momjian wrote:
>>> Jonathan, Stephen, with the minor release done, can we focus on adding
>>> the URL redirect and completing the patch to rename this feature in the
>>> docs?  Thanks.
>>
>> Yes, I have a prototype for this ready, which I had scrambled together
>> before the release. I am happy to make it committable in the coming days.
> 
> Thanks.  Once that is done Stephen can apply my patch with his
> additions.

Please see attached patch for pgweb that allows for the documentation to
be redirected from a page that is removed to a newer page. The way it works:

- Checks to see if a page is found. If it is, great!
- Now if a page 404s, we first check to see if there is a forwarding
address, i.e. the new page. If it is, we issue a 301 (permanent redirecTt).
- If it's still not found, we abort.

I believe this gives us the desired behavior.

Thoughts on the patch?

Thanks,

Jonathan
From e2120f0a80697d13dc6d951f363d01feb60c9b9d Mon Sep 17 00:00:00 2001
From: "Jonathan S. Katz" 
Date: Tue, 11 Feb 2020 14:41:46 -0500
Subject: [PATCH] Introduce documentation redirects for doc pages that are
 renamed

The web documentation used to suffer from a problem that if a
documentation page were renamed in a newer version, any references
pointing to said documentation would be lost. For example, the feature
known as "Default Roles" was renamed to "Privileged Roles" but caused
a change in the URL.

This patch introduces the ability to create a "DocPageRedirect" by
specifying the previous name of the documentation page (e.g.
"default-roles.html") and the new name (e.g. "privileged-roles.html")
such that the continuity is preserved between versions.
---
 pgweb/docs/admin.py   |  3 ++-
 pgweb/docs/migrations/0004_docpageredirect.py | 24 +++
 pgweb/docs/models.py  | 11 +
 pgweb/docs/views.py   | 15 ++--
 4 files changed, 50 insertions(+), 3 deletions(-)
 create mode 100644 pgweb/docs/migrations/0004_docpageredirect.py

diff --git a/pgweb/docs/admin.py b/pgweb/docs/admin.py
index d2f2590..79f1d12 100644
--- a/pgweb/docs/admin.py
+++ b/pgweb/docs/admin.py
@@ -1,5 +1,6 @@
 from django.contrib import admin
 
-from .models import DocPageAlias
+from .models import DocPageAlias, DocPageRedirect
 
 admin.site.register(DocPageAlias)
+admin.site.register(DocPageRedirect)
diff --git a/pgweb/docs/migrations/0004_docpageredirect.py 
b/pgweb/docs/migrations/0004_docpageredirect.py
new file mode 100644
index 000..d19f959
--- /dev/null
+++ b/pgweb/docs/migrations/0004_docpageredirect.py
@@ -0,0 +1,24 @@
+# Generated by Django 2.2.12 on 2020-04-24 23:16
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+dependencies = [
+('docs', '0003_docs_alias'),
+]
+
+operations = [
+migrations.CreateModel(
+name='DocPageRedirect',
+fields=[
+('id', models.AutoField(auto_created=True, primary_key=True, 
serialize=False, verbose_name='ID')),
+('redirect_from', models.CharField(max_length=64, unique=True, 
help_text='Page to redirect from, e.g. "old_page.html"')),
+('redirect_to', models.CharField(max_length=64, unique=True, 
help_text='Page to redirect to, e.g. "new_page.html"')),
+],
+options={
+'verbose_name_plural': 'Doc page redirects',
+},
+),
+]
diff --git a/pgweb/docs/models.py b/pgweb/docs/models.py
index 87afe1c..a4558a6 100644
--- a/pgweb/docs/models.py
+++ b/pgweb/docs/models.py
@@ -33,3 +33,14 @@ class DocPageAlias(models.Model):
 class Meta:
 db_table = 'docsalias'
 verbose_name_plural = 'Doc page aliases'
+
+
+class DocPageRedirect(models.Model):
+"""DocPageRedirect offers the ability to redirect from a page that has been
+completely removed from the PostgreSQL documentation
+"""
+redirect_from = models.CharField(max_length=64, null=False, blank=False, 
unique=True, help_text='Page to redirect from, e.g. "old_page.html"')
+redirect_to = models.CharField(max_length=64, null=False, blank=False, 
unique=True, help_text='Page to redirect from, e.g. "new_page.html"')
+
+class Meta:
+verbose_name_plural = "Doc page redirects"
diff --git a/pgweb/docs/views.py b/pgweb/docs/views.py
index 0566129..6763795 100644
--- a/pgweb/docs/views.py
+++ b/pgweb/docs/views.py
@@ -16,7 +16,7 @@ from pgweb.util.misc import send_template_mail
 from pgweb.core.models import Version
 from pgweb.util.db import exec_to_dict
 
-from .models import DocPage
+from .models import DocPage, DocPageRedirect
 from .forms import DocCommentForm
 
 
@@ -94,7 +94,18 @@ def docpage(request, version, filename):
 url += "{}/{}".format(release_version, fullname)
 return