Re: minor gripe about lax reloptions parsing for views - Mailing list pgsql-hackers

From Mark Dilger
Subject Re: minor gripe about lax reloptions parsing for views
Date
Msg-id 8F154BB9-971C-4585-8079-504838E41938@enterprisedb.com
Whole thread Raw
In response to Re: minor gripe about lax reloptions parsing for views  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: minor gripe about lax reloptions parsing for views  (Mark Dilger <mark.dilger@enterprisedb.com>)
List pgsql-hackers

> On Oct 1, 2021, at 6:15 AM, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
>
> On 2021-Sep-30, Mark Dilger wrote:
>
>> The solution is simple enough:  stop using HEAP_RELOPT_NAMESPACES when
>> parsing reloptions for views and instead create a
>> VIEW_RELOPT_NAMESPACES array which does not include "toast".
>
> It seems a reasonable (non-backpatchable) change to me.

I agree.  It's neither important enough to be back-patched nor completely non-breaking.  Somebody could be passing
bogusreloptions and relying on the parser to ignore them. 

>> I've already fixed this, mixed into some other work.  I'll pull it out
>> as its own patch if there is any interest.
>
> Yeah.
>
> I suppose you'll need a new routine that returns the namespace array to
> use based on relkind.

The patch does it this way.  The new routine can just return NULL for relkinds that don't accept "toast" as an option
namespace. We don't need to create the VIEW_RELOPT_NAMESPACES array mentioned upthread. 

The patch changes the docs for index storage option "fillfactor".  The existing documentation imply that all index
methodssupport this parameter, but in truth built-in methods brin and gin do not, and we should not imply anything
aboutwhat non-built-in methods do. 

The changes to create_view.sql demonstrate what the patch has fixed.

The other changes to regression tests provide previously missing test coverage of storage options for which the
behavioris unchanged.  I prefer to have coverage, but if the committer who picks this up disagrees, those changes could
justbe ignored.  I'd also be happy to remove them and repost if the committer prefers. 




—
Mark Dilger
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company




Attachment

pgsql-hackers by date:

Previous
From: David Zhang
Date:
Subject: Re: Fix uninitialized variable access (src/backend/utils/mmgr/freepage.c)
Next
From: Jeremy Schneider
Date:
Subject: Re: BUG #16583: merge join on tables with different DB collation behind postgres_fdw fails