Re: [PATCH] Store Extension Options

From: Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: [PATCH] Store Extension Options
Date: 2013-12-31 13:48:25
Message-ID: CAFcNs+rQD=j-TVf6zUOv3MJ3y2-dx1U9B9mLPrCudYCyk0Mm+g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Dec 31, 2013 at 10:37 AM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
wrote:
>
> 2013/12/31 Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>
>>
>> On Tue, Dec 31, 2013 at 9:38 AM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
wrote:
>> >
>> > 2013/12/31 Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>
>> >>
>> >> On Tue, Dec 31, 2013 at 9:08 AM, Pavel Stehule <
pavel(dot)stehule(at)gmail(dot)com> wrote:
>> >> >
>> >> > Hello
>> >> >
>> >> > I am looking on this patch
>> >> >
>> >> > ALTER TABLE foo SET (ext.somext.do_replicate=true);
>> >> >
>> >> > Why is there fixed prefix "ext" ?
>> >> >
>> >> > This feature is similar to attaching setting to function
>> >> >
>> >> > CREATE OR REPLACE FUNCTION ... SET var = ...;
>> >> >
>> >> > We can use someprefix.someguc without problems there.
>> >> >
>> >>
>> >> Hi,
>> >>
>> >> We use the prefix "ext" (aka namespace) to distinguish these options
which are related to "extensions".
>> >>
>> >> Have you seen the previous thread [1] ?
>> >
>> >
>> > yes, but I don't understand why it is necessary? I use a analogy with
custom GUC - and there we don't use similar prefix. Only any prefix is
required - and it can contain a dot.
>> >
>>
>> We use the namespace "ext" to the internal code
(src/backend/access/common/reloptions.c) skip some validations and store
the custom GUC.
>>
>> Do you think we don't need to use the "ext" namespace?
>
>
> yes - there be same mechanism as we use for GUC
>

If we going to that way then we can expand the use of this patch to store
custom GUCs to functions also, and we can wrote a function (like
current_setting) to get specific GUC values, like:

ALTER TABLE foo SET (myextension.option=on);

SELECT current_setting('foo'::regclass, 'myextension.option');

Comments?

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
>> Timbira: http://www.timbira.com.br
>> Blog sobre TI: http://fabriziomello.blogspot.com
>> Perfil Linkedin: http://br.linkedin.com/in/fabriziomello
>> Twitter: http://twitter.com/fabriziomello

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2013-12-31 14:34:07 Re: Patch: show relation and tuple infos of a lock to acquire
Previous Message Alvaro Herrera 2013-12-31 13:22:54 Re: PoC: Partial sort