Re: another idea for changing global configuration settings from SQL

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: another idea for changing global configuration settings from SQL
Date: 2013-02-12 10:27:55
Message-ID: CAFj8pRBf6suKewDCiXiGy=NeYY_Ns9CAZemomvRYsAQ=UpLzNA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello Peter

I am looking on your patch.

I found only one issue

in documentation is role name or keyword ALL marked as optional, but
it is mandatory

+ALTER ROLE [ <replaceable class="PARAMETER">name</replaceable> | ALL
] [ IN DATABASE <replaceable
class="PARAMETER">database_name</replaceable> ] SET
<replaceable>configuration_parameter</replaceable> FROM CURRENT
+ALTER ROLE [ <replaceable class="PARAMETER">name</replaceable> | ALL
] [ IN DATABASE <replaceable
class="PARAMETER">database_name</replaceable> ] RESET
<replaceable>configuration_parameter</replaceable>
+ALTER ROLE [ <replaceable class="PARAMETER">name</replaceable> | ALL
] [ IN DATABASE <replaceable
class="PARAMETER">database_name</replaceable> ] RESET ALL

should be

+ALTER ROLE { <replaceable class="PARAMETER">name</replaceable> | ALL
} [ IN DATABASE <replaceable
class="PARAMETER">database_name</replaceable> ] SET
<replaceable>configuration_parameter</replaceable> FROM CURRENT
+ALTER ROLE { <replaceable class="PARAMETER">name</replaceable> | ALL
} [ IN DATABASE <replaceable
class="PARAMETER">database_name</replaceable> ] RESET
<replaceable>configuration_parameter</replaceable>
+ALTER ROLE { <replaceable class="PARAMETER">name</replaceable> | ALL
} [ IN DATABASE <replaceable
class="PARAMETER">database_name</replaceable> ] RESET ALL

???

Regards

Pavel Stehule

2013/1/15 Peter Eisentraut <peter_e(at)gmx(dot)net>:
> On 11/15/12 12:53 PM, Peter Eisentraut wrote:
>> We already have the ability to store in pg_db_role_setting configuration
>> settings for
>>
>> specific user, specific database
>> specific user, any database
>> any user, specific database
>>
>> The existing infrastructure would also support
>>
>> any user, any database (= all the time)
>>
>> All you'd need is to add
>>
>> ApplySetting(InvalidOid, InvalidOid, relsetting, PGC_S_$SOMETHING);
>>
>> in postinit.c, and have some SQL command to modify this setting.
>
> Here is a patch for that.
>
> The internals are straightforward. Actually, we might want to refactor
> this a bit later, unifying the AlterRoleSet and AlterDatabaseSet parse
> nodes and the functions that do the work, because it's really all the same.
>
> The SQL level interface is a bit odd. The existing facilities are
>
> ALTER ROLE / SET
> ALTER DATABASE / SET
> ALTER ROLE / IN DATABASE / SET
>
> Since the original design somehow considered roles to be superior to
> databases in this regard, I added the global setting as ALTER ROLE ALL
> SET ..., but that's obviously arbitrary. Most other variants would
> probably be much more invasive, though.
>
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ivan Lezhnjov IV 2013-02-12 11:03:32 Re: backup.sgml patch that adds information on custom format backups
Previous Message Magnus Hagander 2013-02-12 09:40:39 Re: Documentation: references to old versions