Skip to content

z_<version> convention for pg_regress tests #1588

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
steve-chavez opened this issue May 8, 2025 · 0 comments
Open

z_<version> convention for pg_regress tests #1588

steve-chavez opened this issue May 8, 2025 · 0 comments
Assignees

Comments

@steve-chavez
Copy link
Member

steve-chavez commented May 8, 2025

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.

@steve-chavez steve-chavez self-assigned this May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant