Re: WIP: Rework access method interface

From: Petr Jelinek <petr(at)2ndquadrant(dot)com>
To: Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: WIP: Rework access method interface
Date: 2015-08-31 10:28:19
Message-ID: 55E42C43.7080500@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2015-08-27 15:15, Alexander Korotkov wrote:
> On Wed, Aug 26, 2015 at 7:20 PM, Alexander Korotkov
> <a(dot)korotkov(at)postgrespro(dot)ru <mailto:a(dot)korotkov(at)postgrespro(dot)ru>> wrote:
>
> On Wed, Aug 26, 2015 at 6:50 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us
> <mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us>> wrote:
>
> One thought here is that we might not want to just blindly duplicate
> the existing pg_am behavior anyway. For example, the main use
> of the
> amstrategies column was to allow validation of pg_amop.amopstrategy
> entries --- but in 4 out of the 6 existing AMs, knowledge of the
> AM alone
> isn't sufficient information to determine the valid set of strategy
> numbers anyway. So inventing a "pg_amstrategies(am oid)"
> function seems
> like it would be repeating a previous failure. Not quite sure
> what to
> do instead, though. We could imagine something like
> "pg_amstrategies(am
> oid, opclass oid)", but I don't see how to implement it without
> asking
> opclasses to provide a validation function, which maybe is a
> change we
> don't want to take on here.
>
>
> Could we add another function to access method interface which would
> validate opclass?
> Am could validate this way not only strategies, but also supporting
> functions. For instance, in GIN, we now require opclass to specify
> at least one of consistent and triconsistent. ISTM I would be nice
> to let the access method check such conditions. Also, we would be
> able to check opclass correction on its creation. Now one can create
> opclass with missing support functions which doesn't work.
> In the SQL-level we can create function which validates opclass
> using this new method. This function can be used in regression tests.
>
>
> Should I try to implement such new access method function, say 'amvalidate'?
>

Makes sense to me to do that, should be probably optional though.

--
Petr Jelinek http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2015-08-31 10:35:45 Re: On-demand running query plans using auto_explain and signals
Previous Message Daniel Verite 2015-08-31 09:47:52 Re: [patch] Proposal for \rotate in psql