Skip to content

Before you start

You need four things.

  1. PostgreSQL 16, 17 or 18. 18 is the primary target, and 16 and 17 are built and tested from the same sources, so all three work.

    The test matrix also covers the operating system you are most likely on: Rocky Linux 8 and 9, Debian 12, Ubuntu 22.04, 24.04 and 26.04 LTS, and Fedora 44. See Tested Platforms if you want the specifics.

  2. The extension installed and enabled, which is a job for your DBA. It has to be listed in shared_preload_libraries and the server restarted. If that has not been done, you will see this the moment you try:

    ERROR:  pg_vault_tables must be loaded via shared_preload_libraries
    

    See Installation.

  3. Permission to create tables in the schema you are working in. That is ordinary PostgreSQL permission and nothing to do with this extension.

  4. A clear idea of what the table is for. This matters more here than usual, and the next point explains why.


The one thing to understand before you begin

You cannot change your mind later.

A vault table's permissions are fixed when it is created. There is no ALTER TABLE that adds a permission, removes one, or changes the retention period. If you get it wrong, the fix is to create a new table with the right settings and copy the data across.

And if the table you got wrong does not grant drop, you cannot even remove it afterwards. It stays there.

So before you type CREATE TABLE, be sure about:

  • Which operations this table genuinely needs to allow.
  • Whether rows need a retention period, and how long.

There is a whole page on this — What You Cannot Change — and it is worth five minutes of your time before you create anything.

Try it somewhere safe first

Create your table in a scratch database and check it behaves the way you expect before creating it for real. Because you cannot alter it afterwards, a dry run costs you nothing and can save you a lot.