Re: contrib modules and relkind check

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
Cc: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: contrib modules and relkind check
Date: 2017-02-10 05:32:14
Message-ID: CAB7nPqSw_1B9tvhNhYrsZ8wBy0pBojs=915upGWCiKvz+Hz+og@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Feb 9, 2017 at 7:21 AM, Corey Huinker <corey(dot)huinker(at)gmail(dot)com> wrote:
> Is this still needing a reviewer?

Useful input is always welcome.

> Code is quite clear. It does raise two questions:
>
> 1. should have these tests named in core functions, like maybe:
>
> relation_has_visibility(Relation)
> relation_has_storage(Relation)
> and/or corresponding void functions check_relation_has_visibility() and
> check_relation_has_storage() which would raise the appropriate error message
> when the boolean test fails.
> Then again, this might be overkill since we don't add new relkinds very
> often.

The visibility checks are localized in pg_visibility.c and the storage
checks in pgstatindex.c, so yes we could have macros in those files.
Or even better: just have a sanity check routine as the error messages
are the same everywhere.

> 2. Is it better stylistically to have an AND-ed list of != tests, or a
> negated list of OR-ed equality tests, and should the one style be changed to
> conform to the other?
>
> No new regression tests. I think we should create a dummy partitioned table
> for each contrib and show that it fails.

Yep, good point. That's easy enough to add.

By the way, partition tables create a file on disk but they should
not... Amit, I think you are working on a patch for that as well?
That's tweaking heap_create() to unlist partitioned tables and then be
sure that other code paths don't try to look at the parent partitioned
table on disk.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2017-02-10 05:49:09 Re: Partition-wise join for join between (declaratively) partitioned tables
Previous Message Corey Huinker 2017-02-10 05:13:30 Re: \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless)