Skip to content
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

Enable PGMQ to run without installing an extension #379

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

axelfontaine
Copy link

@axelfontaine axelfontaine commented Feb 9, 2025

This pull request enables the installation of PGMQ using a simple psql command:

psql < pgmq.sql

It does NOT affect the existing functionality, nor does it impact PGMQ's ability to be installed as an extension.

This addresses the following issues directly and inderectly:

To achieve this the following was changed:

  • The pgmq schema gets created if it doesn't already exist
  • The actual implementation of send and send_batch are moved higher up the SQL file so they can be found when referenced by the convenience functions with less arguments
  • A new _extension_exists function is introduced to check the existance of arbitrary extensions
  • The implementation of _ensure_pg_partman_installed has been retrofitted to use the new _extension_exists function.
  • All references to the pgmq extension have been guarded with _extension_exists('pgmq')

…T EXISTS to skip object creation if the conflicting object is one that it already owns."
@ChuckHend
Copy link
Member

This is awesome, thank you for doing this @axelfontaine. I will look it over in the next few days.

@ChuckHend
Copy link
Member

image builds are going to fail for PR coming from an external repo (we still need a better way to configure that in CI), so we can ignore those failures.

@v0idpwn
Copy link
Collaborator

v0idpwn commented Feb 11, 2025

This is great. I think we should have tests run on it, though.

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

Successfully merging this pull request may close these issues.

3 participants