💾 Archived View for gemini.bortzmeyer.org › fosdem › event-11486.gmi captured on 2022-04-29 at 01:08:13. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2022-01-08)

-=-=-=-=-=-=-

FOSDEM event "Getting on a hook or PostgreSQL extensibility"

Alexey Kondratov

Type devroom

Starts on day 2 (2021-02-07) at 11:30 (Brussels time, UTC+1) in room Postgresql (duration 00:30)

Matrix room #postgresql:fosdem.org

PostgreSQL is well-known for its extensibility. One can create their own types, operators, access methods, etc. or use powerful PL/pgSQL language to write functions, extensions, and so on and so on. Everything is thoroughly documented, supported and ready to use. However, there is also a very intimate extensibility layer, which allows external developers to peek right into the PostgreSQL core — hooks. For some reason this topic is not covered enough by official documentation.

First, this talk will focus on which core hooks do exist, which options they provide for potential developers, and which PostgreSQL extensions get use of them to achieve an additional out-of-core functionality.

Next part will show an example of how one can consistently distribute some DDL across multiple PostgreSQL instances. This is based on experience got from Postgres Professional's take on sharded Postgres (first alpha version of

Finally, there will be demonstrated a tricky way to extend CREATE TABLE syntax using PostgreSQL hooks without even touching the core. So one was able to do, e.g.:

CREATE TABLE users (
  id      int not null,
  name    text
) WITH (distributed_by = 'id',
        num_parts = 12,
        colocate_with = 'companies');

FOSDEM schedule page