---
title: "Working with row level security in Postgres"
publication: "Postgres Weekly"
issue: 320
published_at: "2019-08-28"
canonical_url: "https://postgresweekly.com/issues/320"
---

The latest Postgres news, articles, tools, and projects.       

#320 — August 28, 2019 

[Read on the Web](https://postgresweekly.com/issues/320)   

Postgres Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60/v1566985036/yo4lnibdiishpaptekox.png)](https://theartofpostgresql.com/)   

[The Art of PostgreSQL, Second Edition](https://theartofpostgresql.com/) — One of the Postgres project’s main contributors has put together an appealing second edition package here, including a new edition of his popular book, interviews, code, and examples digging deep into Postgres. (But, yes, it costs money.) 

Dimitri Fontaine   

[Row Level Security, Views and a Lot of Magic](https://www.cybertec-postgresql.com/en/postgresql-row-level-security-views-and-a-lot-of-magic/) — Row Level Security (RLS) is a key Postgres feature that lets you define granular policies on which rows specific users can view or manipulate. Here’s a look at how they work and a problem Cybertec discovered with the feature. 

Hans-Jürgen Schönig   [![\](https://copm.s3.amazonaws.com/f43d9c46.png)](https://pganalyze.com/ebooks/monitoring-postgres-logs?utm_source=PostgresWeeklyPrimary) 

[eBook: The Most Important Events to Monitor in Your Postgres Logs](https://pganalyze.com/ebooks/monitoring-postgres-logs?utm_source=PostgresWeeklyPrimary) — In this pganalyze eBook, we are looking at the Top 6 Postgres log events for monitoring query performance and preventing downtime. 

pganalyze sponsor   

[How Timescale is Building a Distributed Time-Series Database on Top of Postgres](https://blog.timescale.com/blog/building-a-distributed-time-series-database-on-postgresql/) — [TimescaleDB](https://github.com/timescale/timescaledb) is a popular extension that brings time-series database features to Postgres. Here, Timescale share their design, plans, and benchmarks for a new (and still in closed beta) _distributed_ version of TimescaleDB. 

Mike Freedman and Erik Nordström (Timescale)   

[Using Patroni for Managing High Availability in Postgres](https://scalegrid.io/blog/managing-high-availability-in-postgresql-part-3/) — A technical comparison of Patroni versus repmgr and PAF for managing highly available Postgres clusters. 

Madan Kumar   

[Quickly Generate Diagrams of Your Postgres Database](https://github.com/nsingla/dbdiagrams) — [dbdiagram.io](https://dbdiagram.io/home) is an online tool for drawing database relationship diagrams using a simple DSL language. This short script turns your Postgres-based database into that language. 

Holistics Software   

[6 Things a Developer Should Know About Postgres](https://info.enterprisedb.com/Tech-Guide-6-Things-a-Developer-Should-Know-About-Postgres-paper.html?utm_source=Cooperpress&utm_medium=ad) — Download our white paper to learn why PostgreSQL has seen a sharp rise in popularity among developers. 

EnterpriseDB sponsor   

[PgBouncer 1.11.0 Released](https://pgbouncer.github.io/2019/08/pgbouncer-1-11-0) — The major new feature in the latest version of the popular connection pooler is support for SCRAM authentication. Improved Postgres 12 support too. 

Peter Eisentraut   

[Getting PL/Proxy Running with PostgreSQL 11 and FreeBSD 12](https://fluca1978.github.io/2019/08/26/PLProxy_FreeBSD.html) — Very niche, but if you need to do it, it’s not easy and this new pull request on the project will help. Luca also suggests [a way to get it working with Postgres 12](https://fluca1978.github.io/2019/08/27/PLProxyPostgreSQL12.html) but recommends not to use it in production yet. 

Luca Ferrari      supported by [![Datadog\](https://res.cloudinary.com/cpress/image/upload/v1566815662/buz6rhyghoxpslxmnfni.png)](https://www.datadoghq.com/postgres-monitoring/?utm_source=Advertisement&utm_medium=CooperPress&utm_campaign=CooperPress-PostgresWeeklyTip)  

💡**Tip of the Week** 

`SELECT DISTINCT` 

Today's tip is _really_ simple, but I know plenty of Postgres users aren't familiar with it. We'll be building from this simple tip into more interesting and complex `DISTINCT` examples over the coming weeks. 

At the most basic level, `DISTINCT` is a keyword you can use on `SELECT` queries to eliminate duplicate rows from the end result. For example:  

SELECT DISTINCT city FROM employees;   

This simple example is basically a nicer looking equivalent to:  

SELECT city FROM employees GROUP BY city;   

But it goes a bit further than that.. 

This Tip of the Week is sponsored by [Datadog](https://www.datadoghq.com/postgres-monitoring/?utm_source=Advertisement&utm_medium=CooperPress&utm_campaign=CooperPress-PostgresWeeklyTip). Monitor custom PostgreSQL metrics with Datadog.      

🗓**Upcoming Events** 

- [PGDay Austria 2019](https://pgday.at/en/) (September 6 in Wiener Neustadt, Austria)
- [PostgreSQL Conference Asia 2019](http://2019.pgconf.asia/) (September 8-11 in Bali, Indonesia)
- [PostgresOpen 2019](https://2019.postgresopen.org/) (September 11-13, in Orlando, Florida) — Two days packed with tutorials and presentations about PostgreSQL and related tech.
- [PostgresConf Silicon Valley 2019](https://postgresconf.org/conferences/SV2019) (September 18-20 in San Jose) — The schedule (including training) has now been published.
- [PostgresConf South Africa 2019](https://postgresconf.org/conferences/SouthAfrica2019) (October 8-9 in Johannesburg) — An opportunity for the database administration and developer community who use Postgres to get to know each other.
- [PostgreSQL Conference Europe 2019](https://2019.pgconf.eu/) (October 15-18 in Milan, Italy)          

Curated by [Cooperpress](https://cooperpress.com/), [Peter Cooper](https://twitter.com/peterc), and [Craig Kerstiens](https://twitter.com/craigkerstiens). 

[Change your email address](https://postgresweekly.com/edit_subscription/*|UID|*) or[Stop getting this newsletter](https://postgresweekly.com/leave/*|UID|*) 

© Cooper Press Ltd · Fairfield Enterprise Centre, Louth, LN11 0LS, United Kingdom
