Skip to content

z_<version> convention for pg_regress tests #1588

@steve-chavez

Description

@steve-chavez

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions