Re: WIP: Rework access method interface

From: Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>
To: Teodor Sigaev <teodor(at)sigaev(dot)ru>
Cc: Petr Jelinek <petr(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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-09-18 12:58:06
Message-ID: CAPpHfdt990N2PjVraMSRbZc5S5yiAyy_6M8hRUAaN3ty_F2vWA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Sep 16, 2015 at 8:44 PM, Teodor Sigaev <teodor(at)sigaev(dot)ru> wrote:

> validate_opclass was renamed to amvalidate.
>>
>
> It seems to me, that amvalidate method of AM should get as argument only
> Oid of operator family. Layout and meaning of amproc/amop fields are differ
> for different AM and there isn't an AM which implements all possible
> features.
>
> Actually, I'm a bit confused with follow piece of code (ginvalidate, for
> instance):
> foreach(l, opclass->procedures)
> {
> ...
> if (proc->lefttype != opclass->intype
> || proc->righttype != opclass->intype)
> continue;
> ...
>
> That is amproc could contain a row, which connected to some operator class
> but this fact will be missed this check and may be, never used or used
> wrongly.
>
> Despite these observations, I think that this work is needed.

After, further personal discussion with Teodor, we decided that amvalidate
is out of scope for this patch.
It's not evident what should we validate in amvalidate and which way. I
think if we need amvalidate it should be subject of separate patch.
The attached patch exposes index access method parameters to SQL using
following fucntions:
* get_am_param_oid(oid, text)
* get_am_param_int(oid, text)
* get_am_param_bool(oid, text)

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Attachment Content-Type Size
aminterface-5.patch application/octet-stream 225.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Adam Brightwell 2015-09-18 13:01:15 Re: row_security GUC, BYPASSRLS
Previous Message Pavel Stehule 2015-09-18 12:25:19 Re: [patch] Proposal for \rotate in psql