#319 — August 21, 2019

Read on the Web

Postgres Weekly

Percona Distribution for Postgres 11 (Beta) Now Available — Percona, perhaps more historically known for its MySQL performance expertise, is now in the PostgreSQL world too. This Percona-flavored distribution of Postgres 11 includes a variety of tools and extensions to make Postgres more powerful and scaleable.

Borys Belinsky (Percona)

Building Faster, Lightweight Trigger Functions in C — Trigger functions/procedures (functions that run automatically when certain events occur on a table) are commonly written in PL/pgSQL, but C can come in handy when high performance is absolutely essential.

Jobin Augustine

📕 20 Patterns to Watch for in Engineering Teams — GitPrime's new book draws together some of the most common software team dynamics, observed in working with hundreds of enterprise engineering organizations. Actionable insights to help you debug your development process with data. Get your copy.

GitPrime sponsor

Rotating Postgres Passwords with No Downtime — The basic idea is to create separate roles and temporarily have two active at the same time before deactivating the ‘old’ one.

Jannik Arndt

Porting a Postgres Extension from Unix to Windows 10 — Building your own Postgres extension from scratch is one thing, porting an existing one to support a different operating system is quite another, particularly when Windows is the target. Few of you are unlikely to need to do this, but these notes may be invaluable if you do..

Johann ‘Myrkraverk’ Oskarsson

A Process for Developing on Many Versions of Postgres at Once

Craig Ringer

See How Easy Managing Access to Postgres Can Be — Splunk's CISO says "strongDM lets you see what happened, replay and analyze incidents. You can't get that anywhere else."

strongDM sponsor

A Function to Clone a Schema — A developer needed a function to clone/copy schemas in Postgres, fixed it up to support materialized views, and has re-released it here.

Denish Patel

pgsodium: A Postgres Extension for Using libsodiumlibsodium is a crypto library for encryption, decryption, signatures, password hashing and more.

Michel Pelletier

supported by Chaos Conf

💡 Tip of the Week

Putting comments on objects in your database

Did you know Postgres supports storing comments against almost anything (such as columns, roles, domains, tables, triggers, and more) in your database? The process is pretty simple.

COMMENT ON [thing] IS 'your comment goes here'

Here's one example of why this is useful.

Let's say you have a database a little like ours. If you use psql and run \dt+ you get a view of the tables in the database along with an (empty) description column:

The 'description' field comes via comments left upon the tables. Let's set one of our own:

COMMENT ON TABLE issues IS 'Newsletter issues';

This is the absolute most basic example of using comments, but they have a lot more utility (for example, you could give basic descriptions of more complex indexes, triggers, procedures, etc. that will help other people on your project to understand your database). You can learn more in the COMMENT command documentation.

This tip of the week is brought to you by Chaos Conf, the flagship event for all things Chaos Engineering and resilience. Learn more at chaosconf.io.

🗓 Upcoming Postgres Events