Integrate postgresqlCO.NF in your site

This script will identify all the usages you do of postgresql.conf parameters in your blog post and will automatically highlight them such that when you hover you will see additional information about that parameter.

See this screenshot as an example.

Screenshot

TL;DR

  • Include <script defer src="https://postgresqlco.nf/assets/snippet/postgresqlco.nf.docs.min.js"></script> in your HTML header.
  • Select the CSS class that you want to use for the snippet. For example, choose my-conf-post.
  • Add a script with CONF.init('.my-conf-post'); at the buttom (in a DOMContentLoaded event or similar) to activate the snippet in the content.
    For example: <script> document.addEventListener("DOMContentLoaded", function () { CONF.init('.my-conf-post'); }); </script>
  • Enjoy!

Get started

This small snippet consist in a JavaScript code that search through the content marked by a CSS class and renders a pretty tooltip over all the Postgres parameters found.

First, lets see a simple html example:

This normal text without many whistles with mentions to some PostgreSQL parameters.

Let's go by steps:

  1. Line 4: declares the use of the javascript snippet in the html.
  2. Line 7: declares the CSS class, in the example we are using my-conf-post, but can be anything you already use like article-post, etc.
  3. Line 12: Initialize the snippet to look at the CSS class (my-conf-post) and find all the parameters that match.
  4. Line 11-13: The initialization block runs inside a function on the event DOMContentLoaded, you can use jQuery $(document).ready() or whatever method to wait until it's safe to manipulate the page.

Final result:

WAL-logging of some bulk operations can be safely skipped by setting wal_level to minimal. While turning off fsync is often a performance benefit, this can result in unrecoverable data corruption. wal_buffers selects a size equal to 1/32nd (about 3%) of shared_buffers.

Conclusion

If you have access to your own website or blog, and talk a lot of PostgreSQL, this little snippet can make the reading of your users more useful, by giving contextual information about Postgres parameters directly in the content. Give it a try!

As you can see, the use of the snippet is really easy, like magic!, feel free to give us your feedback, features request and issues on our public issue tracker.