Re: support for CREATE MODULE - Mailing list pgsql-hackers

From Nathan Bossart
Subject Re: support for CREATE MODULE
Date
Msg-id 20220204233348.GB1535307@nathanxps13
Whole thread Raw
In response to Re: support for CREATE MODULE  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: support for CREATE MODULE  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, Feb 04, 2022 at 05:12:43PM -0500, Tom Lane wrote:
> If we invent modules I think they need to work more like extensions
> naming-wise, ie they group objects but have no effect for naming.
> Alternatively, you could insist that a module *is* a schema for naming
> purposes, with some extra properties but acting exactly like a schema
> for naming.  But I don't see what that buys you that you can't get
> from an extension that owns a schema that contains all its objects.
> 
> On the whole I'm kind of allergic to inventing an entire new concept
> that has as much overlap with extensions as modules seem to.  I'd
> rather try to understand what functional requirements we're missing
> and see if we can add them to extensions.  Yeah, we won't end up being
> bug-compatible with Oracle's feature, but that's not a project goal
> anyway --- and where we have tried to emulate Oracle closely, it's
> often not worked out well (poster child: to_date).

If I'm understanding correctly, you are suggesting that CREATE MODULE would
be more like creating an extension without a control file, installation
script, etc.  Objects would be added aѕ members with something like ALTER
MODULE ADD, and members could share properties such as access control.  And
this might be possible to do by enhancing CREATE EXTENSION instead of
creating a new catalog, dependency type, etc.

I think this could be a nice way to sidestep the naming resolution problems
discussed upthread while still allowing folks to group objects together in
some meaningful way.  Also, while it might be nice to have separate CREATE
EXTENSION and CREATE MODULE commands, perhaps they would use roughly the
same code paths behind the scenes.

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Jim Mlodgenski
Date:
Subject: Re: support for CREATE MODULE
Next
From: Tom Lane
Date:
Subject: Re: Support tab completion for upper character inputs in psql