pglite icon indicating copy to clipboard operation
pglite copied to clipboard

Generic Extension Strategy

Open amerryma opened this issue 1 year ago • 6 comments

Lets say I have a few extensions that the pglite repo doesn't know about, will the expected workflow be to fork pglite, add those extensions as part of the build process, then build it myself?

I have a bunch of extensions I'd like to see used in my pglite db, but doesn't seem like those should be part of the default offering.

amerryma avatar Apr 04 '24 19:04 amerryma

Hey, yes we have a few options for doing generic extensions and a few problems to solve to enable them.

So far to enable pl/pgsql we had to statically link the extension to the build. It should be possible to dynamically link extensions but I believe #56 is what cased issues when I tried to enable this.

One thing to consider is that for the main binary to support arbitrary dynamically loaded extensions we would have to disable any dead code elimination, this will make the build larger. I suspect we will have to have a special WASM binary that enables loadable extensions and others that have a few key ones statically likened, and a minimal build too.

samwillis avatar Apr 05 '24 12:04 samwillis

Ok, great, I'll keep an eye on this space. And just FYI the extensions would be:

plpgsql_check pg_net pg_graphql

amerryma avatar Apr 08 '24 01:04 amerryma

Ok, great, I'll keep an eye on this space. And just FYI the extensions would be:

plpgsql_check pg_net pg_graphql

these extensions are hander cause then use pgrx develop....

yihong0618 avatar Apr 08 '24 01:04 yihong0618

My vote is for AGE https://github.com/apache/age and Search https://github.com/paradedb/paradedb

mingfang avatar Apr 21 '24 23:04 mingfang

Will the Wasm component model be the nicest long-term solution here? My understanding is that this allows some form of dynamic linking. Each extension might be its own Wasm binary that can be dynamically loaded plug-and-play style for the developer.

lastmjs avatar Apr 29 '24 11:04 lastmjs

@lastmjs yes ideally we will have dynamic loading of extensions. There is some complexity around this as it will likely add a little overhead.

The current intention is that core extension such as pl/pgsql will be staticky linked (we have this one already working with static linking)

samwillis avatar Apr 29 '24 17:04 samwillis