`z_<version>` convention for pg_regress tests

Open
#1,588 0 comments 0 reactions 1 assignee View on GitHub

@steve-chavez is already working on this.

Since May 8, 2025.

Assessment

This issue has not been assessed yet.

Description

Problem

The file convention for running version specific pg_regress test files makes testing harder. It needs extra files and duplicate queries. Which also adds noise when reviewing PR diffs. See an example here.

Solution

We can reuse the supautils convention instead, essentially:

create table dummy();
NOTICE:  the event trigger is executed for rolecreator
NOTICE:  transforming rolecreator to superuser
<PG_GE_16>
ERROR:  permission denied to alter role
DETAIL:  Only roles with the SUPERUSER attribute may change the SUPERUSER attribute.
</PG_GE_16>
<PG_GE_14>
ERROR:  must be superuser to alter superuser roles or change superuser attribute
</PG_GE_14>
<PG_GE_13>
ERROR:  must be superuser to alter superusers
</PG_GE_13>
CONTEXT:  SQL statement "alter role rolecreator superuser"
PL/pgSQL function become_super() line 4 at SQL statement

(https://github.com/supabase/supautils/blob/master/test/expected/event_triggers.out.in#L148-L162)

This means we have test.out.in files with conditional blocks, that are then processed before being used as input for pg_regress.

With this we eliminate query duplication and extra files.


There might be a simpler solution. TBD.

Dominant language
Nix
Stars
1.8k
Forks
266
Avg merge
2d 8h
Merged PRs (30d)
25

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from supabase/postgres

All issues in supabase/postgres

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.