-
Notifications
You must be signed in to change notification settings - Fork 77
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
Run setup when creating extension #38
Run setup when creating extension #38
Conversation
This looks good. I'll take a look at the tests. They have had issues ever since we made pg_partman an optional dependency. |
Looks like CI is installing |
hopefully fix that problem over in #39 |
ec38010
to
ad5ab37
Compare
ad5ab37
to
0348250
Compare
Rebased into main and tried to add a test. The toolchain is a bit new for me, so maybe I messed up :) |
This is going to be trickier than I expected :(
|
Co-authored-by: Adam Hendel <[email protected]>
CREATE TABLE IF NOT EXISTS public.pgmq_meta ( | ||
queue_name VARCHAR UNIQUE NOT NULL, | ||
created_at TIMESTAMP WITH TIME ZONE DEFAULT (now() at time zone 'utc') NOT NULL | ||
); |
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.
I think we won't be able to use the IF NOT EXISTS
part since pgmq does not own the existing tables. Might be tricky, I'll have to think how we could handle that.
I don't really follow this. In my manual tests, it seemed to be owned by the extension (the queue tables, though, weren't). The only case I see where this would happen is if the |
I think I ran into this once before and I did not had much luck using |
Additionally, I think you probably want to drop all tables related to the extension if the extension is dropped. We'd need all the tables to belong to the extension so this is done automatically. Unless there's other way. |
Agreed. It'll be quite a bit more scope if we want to handle all of that right now. Alternatively, we could put a fix into list_queues() directly so it doesn't crash, and handle all of the object ownership in another body of work. |
I will give a stab to the "complete solution" in the weekend, maybe I can make it work. If not, I agree on reducing scope. |
Sounds good, and I appreciate the help! You can DM me in Slack if you want, https://join.slack.com/t/tembocommunity/shared_invite/zt-20dtnhcmo-pLNV7_Aobi50TdTLpfQ~EQ |
Closing this in favor of other changes by Adam. |
Closes #32.