-
Notifications
You must be signed in to change notification settings - Fork 84
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
Conversation
…T EXISTS to skip object creation if the conflicting object is one that it already owns."
This is awesome, thank you for doing this @axelfontaine. I will look it over in the next few days. |
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. |
This is great. I think we should have tests run on it, though. |
Tests would be great. At first I was thinking of maybe adding another workflow like the existing extension_upgade.yml, except for the stand-alone mode. Except thinking that through, I'm not sure what upgrading looks like. Do we need to track the current version in some table when in stand-alone mode, then execute the migrate files? I'll think this through a bit more, maybe there is a simpler way. |
@ChuckHend Versioning is not something PGMQ should be concerned with. I use Flyway, but other similar tools will also do the job. Upgrading means copying the PGMQ upgrade script into one's project and giving it the next version according to Flyway's (or whatever other tool's) naming convention. Or simply applying it manually using psql. PGMQ should exclusively deal with queueing. Let other specialized tools handle the versioning. |
Understood. I was thinking of this from the perspective of providing a similar experience to what pgmq has as a Postgres extension, but as stand-alone functionality. It is helpful for me, when troubleshooting, to know which version of the pgmq project folks are running, and versioning is already part of our release process. We don't need to block this PR on versioning though. I do think we need to have some sort of test in place for executing the migration sql files for stand-alone pgmq though, so that we don't break it for all the non extension users. @axelfontaine what do you think? |
This can be tackled by providing a
Agreed. I actually think all tests should be decoupled from GHA and also easily runnable locally at least on Linux, but ideally on all platforms (Win/Mac/Linux). I see that as being separate from this PR as well though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can confirm this did not break any existing functionality. I also ran the python and Rust client tests against this branch.
This pull request enables the installation of PGMQ using a simple
psql
command: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:
pgmq
schema gets created if it doesn't already existsend
andsend_batch
are moved higher up the SQL file so they can be found when referenced by the convenience functions with less arguments_extension_exists
function is introduced to check the existance of arbitrary extensions_ensure_pg_partman_installed
has been retrofitted to use the new_extension_exists
function.pgmq
extension have been guarded with_extension_exists('pgmq')