Re: WIP: Rework access method interface - Mailing list pgsql-hackers

From Alexander Korotkov
Subject Re: WIP: Rework access method interface
Date
Msg-id CAPpHfds8ZyWenz9vW6tE5RZXboL1vU_wSW181vEq+mU+v1dsiw@mail.gmail.com
Whole thread Raw
In response to Re: WIP: Rework access method interface  (Petr Jelinek <petr@2ndquadrant.com>)
Responses Re: WIP: Rework access method interface  (Oleg Bartunov <obartunov@gmail.com>)
Re: WIP: Rework access method interface  (Teodor Sigaev <teodor@sigaev.ru>)
List pgsql-hackers
On Mon, Sep 7, 2015 at 9:17 PM, Petr Jelinek <petr@2ndquadrant.com> wrote:
On 2015-09-04 16:26, Alexander Korotkov wrote:

Attached patch is implementing this. It doesn't pretend to be fully
correct implementation, but it should be enough for proof the concept.
In this patch access method exposes another function: amvalidate. It
takes data structure representing opclass and throws error if it finds
it invalid.
This method is used on new opclass definition (alter operator family
etc. are not yet implemented but planned). Also, there is SQL function
validate_opclass(oid) which is used in regression tests.
Any thoughts?


This is starting to look good.

However I don't like the naming differences between validate_opclass and amvalidate. If you expect that the current amvalidate will only be used for opclass validation then it should be renamed accordingly.

validate_opclass was renamed to amvalidate.
 
Also GetIndexAmRoutine should check the return type of the amhandler.

Fixed.

See the attached patch.

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

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Moving SS_finalize_plan processing to the end of planning
Next
From: Tom Lane
Date:
Subject: Re: Parser emits mysterious error message for very long tokens