Replies: 3 comments 5 replies
-
How do you plan to maintain the event trigger. Doesn't it come done to provide something similar to |
Beta Was this translation helpful? Give feedback.
-
So first it seems that the auth extension never should require the HTTP extension. The HTTP extension should be able to use the auth extension though. An important side question is whether the presence of the shared libraries should allow the HTTP extension to use the auth functions or not. That's a small technical detail and doesn't affect strategy but rather mechanism. This may matter though based on the scope of the service (is it per database? For the whole cluster? For the whole server?) My view is that the best way to handle this is with a runtime check on HTTP server startup and/or triggered by a reload etc. I assume at the moment that this is a custom background worker (and that it doesn't listen on port 80 on *nix and so doesn't need root privileges). I would then allocate a memory context as a child of TopMemoryContext for runtime checks and configuration. Then I would make whatever runtime checks I wanted to do on startup and save the results there, You could also reserve, for example, SIGHUP to rerun these checks. Another option would be to have a list of runtime config options for the HTTP service where a trigger would check for relevant extensions on configuration. An important problem here is that dropping the extension after configuring may have unexpected effects. So you might still need a more limited event trigger. At least that is how I would approach the problem. |
Beta Was this translation helpful? Give feedback.
-
I have little experience designing constellations of extensions, but the idea with event trigger looks the best. As I remember, you connect all the extensions throughout the single connector, right? In that case, it makes sense to design a registration-based trigger subsystem that can help the extension identify the installation/drop of conflicting ones and, why not, execute some SQL scripts. |
Beta Was this translation helpful? Give feedback.
-
Hey fellow @pgedc/members,
Wanted to explore something with you. I am building a constellation of extensions that know how to work with each other, but they are not always supposed to be strictly dependent. For example, I am building an authentication extension and I want to provide some building blocks for using it from HTTP endpoints facilitates by our HTTP server extension.
But naturally, I don't want the authentication extension to require the HTTP server.
I was thinking how should I approach it? One obvious answer is to create another extension (
auth_httpd
) that would require bothauth
andhttpd
extensions and provide whatever it is supposed to provide. Fine, but gets unwieldy and combinatorial :)Another idea that I've worked with and seemed to have delivered good experience was to install event triggers and watch for the extension in question (such as
httpd
) to be installed and provision dependent parts upon creating this extension – while establishing a dependency for the cleanup. I was thinking of even generalizing this so that multiple extensions can easily reuse it without installing individual event triggers.What do you think? How would you approach this?
Beta Was this translation helpful? Give feedback.
All reactions