---
title: "A new way to bring GraphQL into Postgres"
publication: "Postgres Weekly"
issue: 434
published_at: "2021-12-08"
canonical_url: "https://postgresweekly.com/issues/434"
---

Plus how to document your schemas in a useful way. |        

#​434 — December 8, 2021 

[Web Version](https://postgresweekly.com/issues/434)   

Postgres Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60/zjceqauobhlzgzbmberf.jpg)](https://supabase.com/blog/2021/12/03/pg-graphql)  

[pg_graphql: A GraphQL Extension for Postgres](https://supabase.com/blog/2021/12/03/pg-graphql) — The Supabase team has open sourced an extension (still a work in progress, they admit) that adds GraphQL support to Postgres with things like schema generation and query parsing kept entirely within the confines of your database server and not some external service (though [Postgraphile](https://www.graphile.org/postgraphile/) is a fine option in that regard). 

Oliver Rice (Supabase)   

[Understanding GIN Indexes: The Good and the Bad](https://pganalyze.com/blog/gin-index) — Using fancy data types, JSONB documents, and want to index? Skip B-tree indexes and head straight for the GIN ;-) Lukas covers what GIN indexes (introduced into Postgres almost 15 years ago now) are useful for and some potential pitfalls. 

Lukas Fittl   [![\](https://copm.s3.amazonaws.com/0b98a0b8.png)](https://retool.com/?utm_source=sponsor&utm_medium=newsletter&utm_campaign=cooperpress) 

[Develop a Faster Way to Work. Build Internal Tools, Remarkably Fast](https://retool.com/?utm_source=sponsor&utm_medium=newsletter&utm_campaign=cooperpress) — Custom dashboards, admin panels, CRUD apps—build any internal tool faster in Retool. Get started for free today. 

Retool sponsor   

**IN BRIEF:** 

- [pgDay Paris is back in 2022](https://www.postgresql.org/about/news/pgday-paris-2022-call-for-papers-registration-and-sponsors-2365/) on March 24 and.. in person! They're looking for people who want to speak and [the CFP is open](https://2022.pgday.paris/callforpapers/) till December 31.
- 🔥 It's not every day someone [blogs about leaving Oracle](https://blog.sesse.net/blog/tech/2021-12-05-16-41_leaving_mysql.html) (and the MySQL team) and says _"MySQL is a pretty poor database, and you should strongly consider using Postgres instead."_ 🤭 It led to [a lot of discussion on Hacker News](https://news.ycombinator.com/item?id=29455852), too.
- [Supabase](https://supabase.com/) _(mentioned above)_ is an open source Firebase alternative powered by Postgres and they've improved their _Realtime_ service (which listens to changes in a Postgres server in real time) by [adding Row Level Security support.](https://supabase.com/blog/2021/12/01/realtime-row-level-security-in-postgresql)
- [Pgpool-II 4.3.0](https://www.postgresql.org/about/news/pgpool-ii-430-is-now-released-2368/) has been released.   

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60/ihbh6dv4yuppm2cr0qfg.jpg)](https://sqlformat.darold.net/)  

[pgFormatter 5.2: A Tool to Format SQL Code](https://sqlformat.darold.net/) — You can test it out online, or you can grab [the source from GitHub](https://github.com/darold/pgFormatter) (it’s written in Perl) and run it for yourself. 

MigOps   

[Tricks for Faster Spatial Indexes with PostGIS](https://blog.crunchydata.com/blog/tricks-for-faster-spatial-indexes) — If you’re storing information about geographical areas, there’s potential for a lot of _overlap_ which can make indexes less efficient than they could be. Paul explains how spatial indexes can be sensitive to the order of their inputs and how to mitigate problems. 

Paul Ramsey   

[Compressing `pgdump` Dumps with `xz`](https://fluca1978.github.io/2021/12/06/pgdumpxz.html) — _“A not-scientific look at how to compress a set of SQL dumps,”_ says Luca who observes that most SQL dumps are highly compressible due to their textual nature. He uses `xz`, a tool that can achieve higher compression rates than standard `gzip` to compress said dumps with much success. 

Luca Ferrari   

[🧹 5 Data Cleaning Techniques to Perform in Your PostgreSQL Database](https://tsdb.co/data-cleaning-with-postgres) 

Timescale sponsor   

[Some Basic Indexing Best Practices](https://www.pgmustard.com/blog/indexing-best-practices-postgresql) — Some reasonably elementary advice, mostly oriented around not _over_ indexing and choosing your indexing battles wisely. 

Michael Christofides   

[Using `pg_rewrite` for Tidier Table Partitioning](https://www.cybertec-postgresql.com/en/pg_rewrite-postgresql-table-partitioning/) — [pg_rewrite](https://github.com/cybertec-postgresql/pg_rewrite) is an extension from Cybertec that can turn a non-partitioned table into a partitioned one with ‘almost no locking.’ 

Hans-Jürgen Schönig   

[DBDoc: Database Schema Documenter](https://github.com/micahelliott/dbdoc) — A tool (written in Clojure) that provides a simple way to add documentation to your tables. You describe tables in a simple text file and this is then applied as comments onto your actual tables in the database making them viewable in tools like `psql`, DBeaver, Postico, etc. 

Micah Elliott    

**Got a new email?** You can [change your address here](https://postgresweekly.com/edit_subscription/*|UID|*). 

--- 

**Bored of us?** [Click here to stop getting Postgres Weekly](https://postgresweekly.com/leave/*|UID|*). 

--- 

**Got a link for us?** Reply and tell us. We can't include everything but we'll look at anything you send. Thanks! 

--- 

Published by Cooper Press Ltd.
Fairfield Enterprise Centre, Louth, LN11 0LS, United Kingdom 

Postgres, PostgreSQL and the Slonik Logo are trademarks or registered trademarks of the PostgreSQL Community Association of Canada. 

[Stop getting this newsletter.](https://postgresweekly.com/leave/*|UID|*)
