Re: [PATCH] Store Extension Options

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Fabrízio Mello <fabriziomello(at)gmail(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Store Extension Options
Date: 2014-01-06 21:20:30
Message-ID: CA+TgmoZM_t1VnBA=e7ZgzpwGd2CNSWy5FG5K83-vkS3ZXHKE4w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jan 6, 2014 at 2:58 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> On Sun, Jan 5, 2014 at 10:50 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> Now, if bdr is installed but the validation doesn't happen unless bdr
>>> is "loaded" in some sense, then that is an implementation deficiency
>>> that I think we can insist be rectified before this feature is accepted.
>
>> We could add a catalog pg_custom_reloption with a reloption namespace,
>> a reloption name, and a pg_proc OID for a checker-function. This is a
>> lot more overhead than just having a hook the way we do for GUCs, and
>> I'm not sure how you'd handle invalidation, but in theory it solves
>> the problem.
>
> If we're willing to tie the reloption names to extension names, which
> seems reasonable to me, then we don't need a new catalog --- just add
> a checker-function column to pg_extension.

That seems sketchy to me. If somebody sets up a home-brew replication
solution, I can't see why they should have to package it as an
extension to register a reloption. So far, extensions are all about
packaging, not functionality, and I'm not excited about changing that.

> I don't follow your point about invalidation. Once an extension has
> accepted a reloption value, it doesn't get to change its mind later;
> it has to deal with that value somehow forevermore. Using a hook,
> or failing to validate the value at all, certainly isn't going to make
> that requirement go away.

Well... I'm assuming that the contents of the pg_custom_reloption
catalog (or whatever catalog we use) would have to be loaded into some
backend-local cache on first use, so it would need to be invalidated
later as necessary. But come to think of it, that's actually not a
problem at all; we can easily register a syscache callback and that
should work fine. Not sure what I was worried about.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2014-01-06 21:21:15 Re: truncating pg_multixact/members
Previous Message Robert Haas 2014-01-06 21:16:38 Re: [ANNOUNCE] IMCS: In Memory Columnar Store for PostgreSQL