Re: sepgsql contrib module

From: KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: KaiGai Kohei <kaigai(at)kaigai(dot)gr(dot)jp>, PgHacker <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: sepgsql contrib module
Date: 2011-01-21 05:02:58
Message-ID: 4D391382.3010105@ak.jp.nec.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The attached patch is a revised version.

Changeset from the previous revision:
- It fixed up a typo in catalog.
The "process:{transition}" is correct permission name.
- Add checks to avoid inlining function without db_procedure:{execute}
permission. Sorry, process:{transition} shall be checked in other place.
- sepgsql_utility_command() was added as a guest of ProcessUtility_hook,
to control LOAD command, right now.
- Documentation was revised. Mostly, description about permission checks.
- Some mixture of tabs/spaces were fixed.
- Source code comments were revised getting more friendly to pgindent,
as follows:
+/*
+ * sepgsql_mode
+ *
+ * SEPGSQL_MODE_DISABLED: Disabled on runtime
+ * SEPGSQL_MODE_DEFAULT: Same as system settings
+ * SEPGSQL_MODE_PERMISSIVE: Always permissive mode
+ * SEPGSQL_MODE_INTERNAL: Same as permissive, except for no audit logs
+ */

I also tried to run pgindent on the source files. Some of them were revised
well according to the coding rule, but some of them were painful, like:

{
- "db_schema", SEPG_CLASS_DB_SCHEMA,
+ "db_schema", SEPG_CLASS_DB_SCHEMA,
{
- { "create", SEPG_DB_SCHEMA__CREATE },
- { "drop", SEPG_DB_SCHEMA__DROP },
- { "getattr", SEPG_DB_SCHEMA__GETATTR },
- { "setattr", SEPG_DB_SCHEMA__SETATTR },
- { "relabelfrom", SEPG_DB_SCHEMA__RELABELFROM },
- { "relabelto", SEPG_DB_SCHEMA__RELABELTO },
- { "search", SEPG_DB_SCHEMA__SEARCH },
- { "add_name", SEPG_DB_SCHEMA__ADD_NAME },
- { "remove_name", SEPG_DB_SCHEMA__REMOVE_NAME },
- { NULL, 0UL },
- }
+ {
+ "create", SEPG_DB_SCHEMA__CREATE},
+ {
+ "drop", SEPG_DB_SCHEMA__DROP},
+ {
+ "getattr", SEPG_DB_SCHEMA__GETATTR},
+ {
+ "setattr", SEPG_DB_SCHEMA__SETATTR},
+ {
+ "relabelfrom", SEPG_DB_SCHEMA__RELABELFROM},
+ {
+ "relabelto", SEPG_DB_SCHEMA__RELABELTO},
+ {
+ "search", SEPG_DB_SCHEMA__SEARCH},
+ {
+ "add_name", SEPG_DB_SCHEMA__ADD_NAME},
+ {
+ "remove_name", SEPG_DB_SCHEMA__REMOVE_NAME},
+ {
+ NULL, 0UL},}
},

Do we have any workaround to avoid these indenting/formatting?
Or, the reformatted code is better than before?

Thanks,

(2011/01/07 12:02), Robert Haas wrote:
> 2011/1/6 KaiGai Kohei<kaigai(at)ak(dot)jp(dot)nec(dot)com>:
>> If we use result of the `pg_config --sharedir` here, how about this
>> writing style? Or, do we have any other ideas?
>
> I'm not sure - I'll look at your next draft more closely.
>
>> The background of this wikipage is that I was persuading people
>> this feature being worthful, so the contents tend to philosophical
>> things rather than actual specifications.
>
> Yeah.
>
>> I also think wiki page allows us to brush up the documentation
>> rather than exchanging patches effectively. I'll set up a wiki page
>> that contains same contents with *.sgml file to revise documentation
>> stuff to be included into the *.sgml file finally. How about this idea?
>
> Sounds good.
>

--
KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>

Attachment Content-Type Size
sepgsql-v9.1-lite.3.patch application/octect-stream 135.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2011-01-21 05:14:35 Re: SSI and Hot Standby
Previous Message Tatsuo Ishii 2011-01-21 04:56:45 Re: How to know killed by pg_terminate_backend