[PATCH] Add permit_unlogged_tables GUC to control unlogged table creation. - Mailing list pgsql-hackers

From harinath kanchu
Subject [PATCH] Add permit_unlogged_tables GUC to control unlogged table creation.
Date
Msg-id CAO7WNRQkLzXiqPFFaw-Djo8wXgu+EEEwnzhBO=brdiTNw_rKkA@mail.gmail.com
Whole thread Raw
Responses Re: [PATCH] Add permit_unlogged_tables GUC to control unlogged table creation.
List pgsql-hackers
Hello,
This patch implements a new GUC parameter "permit_unlogged_tables" which allows admins to disable creation of unlogged tables or altering the existing tables to be unlogged.

This is useful in environments with strict compliance requirements as well as multi-tenant environments where the provider needs to guarantee durability of customer data.

The default is "true", which is to say that behavior would remain unchanged.

Implementation
- Boolean GUC with PGC_SIGHUP context (reloadable without restart)
- Check in "DefineRelation()" to block "CREATE UNLOGGED TABLE" commands.
- Check in "ATPrepCmd()" to block "ALTER TABLE SET UNLOGGED" commands.
- "ALTER TABLE SET LOGGED" commands remain unaffected and should always work.

Attached the patch for review. Happy to make adjustments based on feedback.

Thanks !

Best,
Harinath






Attachment

pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: index prefetching
Next
From: Robert Haas
Date:
Subject: Re: Enhancing Memory Context Statistics Reporting