`z_<version>` convention for pg_regress tests
@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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from supabase/postgres
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
`supabase/postgres:17.6.1.105` (amd64) — backend SIGSEGV during a heavy pgTAP file, CI-CPU-specific Open
Difficulty 5/5 Over a week Newbie friendliness 30/100