diff --git a/HISTORY b/HISTORY
index dcfd713c15a70061c21b2dc10a8c7712c06e1b5f..18d7b1b724c309f96c95872d895296c06b2176dc 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,5 +1,5 @@
 Release notes for all versions of PostgreSQL can be found on-line at
-http://www.postgresql.org/docs/current/static/release.html
+https://www.postgresql.org/docs/current/static/release.html
 
 Distribution file sets include release notes for their version and preceding
 versions.  Visit the file doc/src/sgml/html/release.html in an HTML browser.
diff --git a/README b/README
index 302028e9928eedf698ff711a7add77ac4ad7b9b1..12de3f1d73cc9e48f804845ccab24b630c2dbd80 100644
--- a/README
+++ b/README
@@ -11,7 +11,7 @@ and functions.  This distribution also contains C language bindings.
 
 PostgreSQL has many language interfaces, many of which are listed here:
 
-	http://www.postgresql.org/download
+	https://www.postgresql.org/download
 
 See the file INSTALL for instructions on how to build and install
 PostgreSQL.  That file also lists supported operating systems and
@@ -23,5 +23,5 @@ distribution; it can be read as described in the installation
 instructions.
 
 The latest version of this software may be obtained at
-http://www.postgresql.org/download/.  For more information look at our
-web site located at http://www.postgresql.org/.
+https://www.postgresql.org/download/.  For more information look at our
+web site located at https://www.postgresql.org/.
diff --git a/README.git b/README.git
index 0bf2b56cb3456035975b8492e8ad5bcc7b86d36c..52cb7223dfb129c18d6404bca46be1e7be13401d 100644
--- a/README.git
+++ b/README.git
@@ -6,7 +6,7 @@ git and so will not be present if you are using a git checkout.
 
 If you are using a git checkout, you can view the most recent installation
 instructions at:
-	http://www.postgresql.org/docs/devel/static/installation.html
+	https://www.postgresql.org/docs/devel/static/installation.html
 
 Users compiling from git will also need compatible versions of Bison, Flex,
 and Perl, as discussed in the install documentation.  These programs are not
diff --git a/doc/TODO b/doc/TODO
index 4b7b3da476193eb994b8aa8c02bf8c8b0cfc81d9..d9d0c0cc52de29af2bf29cd117743c1f37ed73bf 100644
--- a/doc/TODO
+++ b/doc/TODO
@@ -1,3 +1,3 @@
 The TODO list is now maintained at:
 
-	http://wiki.postgresql.org/wiki/Todo
+	https://wiki.postgresql.org/wiki/Todo
diff --git a/doc/bug.template b/doc/bug.template
index 569d4f96b6d0c72304f7e271d7c80d2a0bb61846..70ce03163aff1cb2caa6248fe4a3a1f893998387 100644
--- a/doc/bug.template
+++ b/doc/bug.template
@@ -9,7 +9,7 @@ If you not only found the problem but solved it and generated a patch
 then e-mail it to pgsql-hackers@postgresql.org instead.  Please use the
 command "diff -c" to generate the patch.
 
-You may also enter a bug report at http://www.postgresql.org/ instead of
+You may also enter a bug report at https://www.postgresql.org/ instead of
 e-mailing this form.
 
 ============================================================================
diff --git a/doc/src/sgml/acronyms.sgml b/doc/src/sgml/acronyms.sgml
index bf2273fa8a09705190e53b1add3a98f05952d157..29f85e08468d310e6a61a0fa0aeadea94d4b4eef 100644
--- a/doc/src/sgml/acronyms.sgml
+++ b/doc/src/sgml/acronyms.sgml
@@ -300,7 +300,7 @@
     <listitem>
      <para>
       <ulink
-      url="http://git.postgresql.org/gitweb?p=postgresql.git;a=blob;f=src/backend/access/heap/README.HOT;hb=HEAD">Heap-Only
+      url="https://git.postgresql.org/gitweb?p=postgresql.git;a=blob;f=src/backend/access/heap/README.HOT;hb=HEAD">Heap-Only
       Tuples</ulink>
      </para>
     </listitem>
diff --git a/doc/src/sgml/advanced.sgml b/doc/src/sgml/advanced.sgml
index 7563131eba69d9aca274142297816681caaf0e7f..f47c01987be2c7cdc5e7e8f07cd4ad20f43063be 100644
--- a/doc/src/sgml/advanced.sgml
+++ b/doc/src/sgml/advanced.sgml
@@ -711,7 +711,7 @@ SELECT name, altitude
 
    <para>
     If you feel you need more introductory material, please visit the PostgreSQL
-    <ulink url="http://www.postgresql.org">web site</ulink>
+    <ulink url="https://www.postgresql.org">web site</ulink>
     for links to more resources.
    </para>
   </sect1>
diff --git a/doc/src/sgml/contacts.sgml b/doc/src/sgml/contacts.sgml
index a98162502792186fea8e091d4d3bcebd85faeffa..308eb418a5c8fcfd46d888268443ebbb257702da 100644
--- a/doc/src/sgml/contacts.sgml
+++ b/doc/src/sgml/contacts.sgml
@@ -16,7 +16,7 @@ and the mailing lists themselves.
 <para>
 Refer to the introduction in this manual or to the
 <productname>PostgreSQL</productname>
-<ulink url="http://www.postgresql.org">web page</ulink>
+<ulink url="https://www.postgresql.org">web page</ulink>
 for subscription information to the no-cost mailing lists.
 </para>
 
diff --git a/doc/src/sgml/docguide.sgml b/doc/src/sgml/docguide.sgml
index 810d4dac4018d96dbb74ae37883f118474208586..e8a9778822f29fcb11e5400b2540358c88258ed6 100644
--- a/doc/src/sgml/docguide.sgml
+++ b/doc/src/sgml/docguide.sgml
@@ -449,7 +449,7 @@ checking for fop... fop
 
    <para>
     To produce HTML documentation with the stylesheet used on <ulink
-    url="http://postgresql.org/docs/current">postgresql.org</> instead of the
+    url="https://www.postgresql.org/docs/current">postgresql.org</> instead of the
     default simple style use:
 <screen>
 <prompt>doc/src/sgml$ </prompt><userinput>make STYLE=website html</userinput>
diff --git a/doc/src/sgml/external-projects.sgml b/doc/src/sgml/external-projects.sgml
index 3b51e480f793c0c2b4571d0af6781aab9e83cb51..8457426545777f9fc48d9a8c27bace83e59500b0 100644
--- a/doc/src/sgml/external-projects.sgml
+++ b/doc/src/sgml/external-projects.sgml
@@ -72,7 +72,7 @@
       <entry>JDBC</entry>
       <entry>JDBC</entry>
       <entry>Type 4 JDBC driver</entry>
-      <entry><ulink url="http://jdbc.postgresql.org/"></ulink></entry>
+      <entry><ulink url="https://jdbc.postgresql.org/"></ulink></entry>
      </row>
 
      <row>
diff --git a/doc/src/sgml/info.sgml b/doc/src/sgml/info.sgml
index a59d0c8a4388647e24dbfaec76791a67d2371034..233ba0e6687408c409dd5d2d7449ad4e0ae0079c 100644
--- a/doc/src/sgml/info.sgml
+++ b/doc/src/sgml/info.sgml
@@ -14,10 +14,10 @@
     <listitem>
      <para>
       The <productname>PostgreSQL</productname> <ulink
-      url="http://wiki.postgresql.org">wiki</ulink> contains the project's <ulink
-      url="http://wiki.postgresql.org/wiki/Frequently_Asked_Questions">FAQ</>
+      url="https://wiki.postgresql.org">wiki</ulink> contains the project's <ulink
+      url="https://wiki.postgresql.org/wiki/Frequently_Asked_Questions">FAQ</>
       (Frequently Asked Questions) list, <ulink
-      url="http://wiki.postgresql.org/wiki/Todo">TODO</> list, and
+      url="https://wiki.postgresql.org/wiki/Todo">TODO</> list, and
       detailed information about many more topics.
      </para>
     </listitem>
@@ -28,7 +28,7 @@
     <listitem>
      <para>
       The <productname>PostgreSQL</productname>
-      <ulink url="http://www.postgresql.org">web site</ulink>
+      <ulink url="https://www.postgresql.org">web site</ulink>
       carries details on the latest release and other
       information to make your work or play with
       <productname>PostgreSQL</productname> more productive.
diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml
index 26bfab1ea5fe10355ffe93644c3bc463ed054cb9..becf868a4b8684ed3d1448121f4d8c9f232146a0 100644
--- a/doc/src/sgml/installation.sgml
+++ b/doc/src/sgml/installation.sgml
@@ -346,7 +346,7 @@ su - postgres
   <para>
    The <productname>PostgreSQL</> &version; sources can be obtained from the
    download section of our
-   website: <ulink url="http://www.postgresql.org/download/"></ulink>.  You
+   website: <ulink url="https://www.postgresql.org/download/"></ulink>.  You
    should get a file named <filename>postgresql-&version;.tar.gz</filename>
    or <filename>postgresql-&version;.tar.bz2</filename>. After
    you have obtained the file, unpack it:
@@ -2026,7 +2026,7 @@ kill `cat /usr/local/pgsql/data/postmaster.pid`
    it has recently been verified to build and pass its regression tests
    on that platform.  Currently, most testing of platform compatibility
    is done automatically by test machines in the
-   <ulink url="http://buildfarm.postgresql.org/">PostgreSQL Build Farm</ulink>.
+   <ulink url="https://buildfarm.postgresql.org/">PostgreSQL Build Farm</ulink>.
    If you are interested in using <productname>PostgreSQL</> on a platform
    that is not represented in the build farm, but on which the code works
    or can be made to work, you are strongly encouraged to set up a build
@@ -2202,7 +2202,7 @@ kill `cat /usr/local/pgsql/data/postmaster.pid`
      should take care of it.
     </para>
 
-    <!-- http://archives.postgresql.org/message-id/6064jt6cfm.fsf_-_@dba2.int.libertyrms.com -->
+    <!-- https://archives.postgresql.org/message-id/6064jt6cfm.fsf_-_@dba2.int.libertyrms.com -->
 
     <para>
      One user reports:
@@ -2264,7 +2264,7 @@ hosts=local4,bind4
 
    <sect3>
     <title>Memory Management</title>
-    <!-- http://archives.postgresql.org/message-id/603bgqmpl9.fsf@dba2.int.libertyrms.com -->
+    <!-- https://archives.postgresql.org/message-id/603bgqmpl9.fsf@dba2.int.libertyrms.com -->
 
     <para>
      AIX can be somewhat peculiar with regards to the way it does
diff --git a/doc/src/sgml/problems.sgml b/doc/src/sgml/problems.sgml
index 3f79c6ef90c7c6d6757b20452f124a1b24473e80..6bf74bb399965e81a281b2a191de7cb25b948996 100644
--- a/doc/src/sgml/problems.sgml
+++ b/doc/src/sgml/problems.sgml
@@ -304,7 +304,7 @@
   <para>
    Another method is to fill in the bug report web-form available
    at the project's
-   <ulink url="http://www.postgresql.org/">web site</ulink>.
+   <ulink url="https://www.postgresql.org/">web site</ulink>.
    Entering a bug report this way causes it to be mailed to the
    <email>pgsql-bugs@postgresql.org</email> mailing list.
   </para>
diff --git a/doc/src/sgml/release.sgml b/doc/src/sgml/release.sgml
index c8776c4f9742e730dfcb1abbd36ac3c9f24d661f..f1f4e91252ef852d6bbc81be69c25f30466488df 100644
--- a/doc/src/sgml/release.sgml
+++ b/doc/src/sgml/release.sgml
@@ -56,9 +56,9 @@ For new features, add links to the documentation sections.
    A complete list of changes for each release can be obtained by
    viewing the <link linkend="git">Git</link> logs for each release.
    The <ulink
-   url="http://archives.postgresql.org/pgsql-committers/"><literal>pgsql-committers</literal>
+   url="https://archives.postgresql.org/pgsql-committers/"><literal>pgsql-committers</literal>
    email list</ulink> records all source code changes as well.  There is also
-   a <ulink url="http://git.postgresql.org/gitweb?p=postgresql.git;a=summary">web
+   a <ulink url="https://git.postgresql.org/gitweb?p=postgresql.git;a=summary">web
    interface</ulink> that shows changes to specific files.
   </para>
 
diff --git a/doc/src/sgml/sepgsql.sgml b/doc/src/sgml/sepgsql.sgml
index 6f80933abd909ba3c43cc0e50897d55b65fe8544..0b611eeeca18fd3878b5ccc7eb0a45795276f724 100644
--- a/doc/src/sgml/sepgsql.sgml
+++ b/doc/src/sgml/sepgsql.sgml
@@ -753,7 +753,7 @@ ERROR:  SELinux: security policy violation
   <title>External Resources</title>
   <variablelist>
    <varlistentry>
-    <term><ulink url="http://wiki.postgresql.org/wiki/SEPostgreSQL">SE-PostgreSQL Introduction</ulink></term>
+    <term><ulink url="https://wiki.postgresql.org/wiki/SEPostgreSQL">SE-PostgreSQL Introduction</ulink></term>
     <listitem>
      <para>
       This wiki page provides a brief overview, security design, architecture,
diff --git a/doc/src/sgml/sourcerepo.sgml b/doc/src/sgml/sourcerepo.sgml
index d82706b40b39f3aa155cc0f532b07f518edffed2..f8f6bf2de1dabf1a9a64330aacee304cb3c5b6d6 100644
--- a/doc/src/sgml/sourcerepo.sgml
+++ b/doc/src/sgml/sourcerepo.sgml
@@ -12,7 +12,7 @@
 
  <para>
   Our wiki, <ulink
-  url="http://wiki.postgresql.org/wiki/Working_with_Git"></ulink>,
+  url="https://wiki.postgresql.org/wiki/Working_with_Git"></ulink>,
   has some discussion on working with Git.
  </para>
 
@@ -64,10 +64,10 @@ git clone git://git.postgresql.org/git/postgresql.git
     <para>
      The Git mirror can also be reached via the HTTP protocol, if for example
      a firewall is blocking access to the Git protocol. Just change the URL
-     prefix to <literal>http</>, as in:
+     prefix to <literal>https</>, as in:
 
 <programlisting>
-git clone http://git.postgresql.org/git/postgresql.git
+git clone https://git.postgresql.org/git/postgresql.git
 </programlisting>
 
      The HTTP protocol is less efficient than the Git protocol, so it will be
diff --git a/doc/src/sgml/stylesheet.xsl b/doc/src/sgml/stylesheet.xsl
index c948c612ac44953f1f4302cf945c5b671fd2b531..22dd3b93c626ba287643ae2af095a9afa4e123c2 100644
--- a/doc/src/sgml/stylesheet.xsl
+++ b/doc/src/sgml/stylesheet.xsl
@@ -23,7 +23,7 @@
 <xsl:param name="html.stylesheet">
   <xsl:choose>
     <xsl:when test="$website.stylesheet = 0">stylesheet.css</xsl:when>
-    <xsl:otherwise>http://www.postgresql.org/media/css/docs.css</xsl:otherwise>
+    <xsl:otherwise>https://www.postgresql.org/media/css/docs.css</xsl:otherwise>
   </xsl:choose>
 </xsl:param>