Skip to content

Standardize pg_regress usage#12

Merged
steve-chavez merged 1 commit intoPostgREST:masterfrom
df7cb:regress
Feb 28, 2026
Merged

Standardize pg_regress usage#12
steve-chavez merged 1 commit intoPostgREST:masterfrom
df7cb:regress

Conversation

@df7cb
Copy link
Contributor

@df7cb df7cb commented Feb 27, 2026

Standard PGXS make installcheck usage depends on a existing postgres server. Tests will run in a contrib_regression database created by pg_regress.

The pg_regress option --use-existing makes pg_regress require an existing contrib_regression database, but the Makefile does not create it. Removing that option makes using the testsuite easier.

Similarly, the init.sql file was not loaded by the Makefile, but it is required to run the tests. Move it into tests/sql/ and name it 00_init.sql so it gets run first.

With these changes, the testsuite runs without any further tweaking during the Debian package builds for apt.postgresql.org.

Standard PGXS `make installcheck` usage depends on a existing postgres
server. Tests will run in a contrib_regression database created by
pg_regress.

The pg_regress option --use-existing makes pg_regress require an
existing contrib_regression database, but the Makefile does not create
it. Removing that option makes using the testsuite easier.

Similarly, the init.sql file was not loaded by the Makefile, but it is
required to run the tests. Move it into tests/sql/ and name it
00_init.sql so it gets run first.

With these changes, the testsuite runs without any further tweaking
during the Debian package builds for apt.postgresql.org.

Signed-off-by: Christoph Berg <myon@debian.org>
@steve-chavez
Copy link
Member

Move it into tests/sql/ and name it 00_init.sql so it gets run first.

@df7cb Cool, that really simplifies things. Many thanks!

@steve-chavez steve-chavez merged commit 0a48df6 into PostgREST:master Feb 28, 2026
11 checks passed
@steve-chavez
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants