Re: WIP: Access method extendability

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Teodor Sigaev <teodor(at)sigaev(dot)ru>
Cc: Petr Jelinek <petr(at)2ndquadrant(dot)com>, Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: WIP: Access method extendability
Date: 2016-03-24 15:19:43
Message-ID: 20160324151943.GA672723@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera wrote:
> Teodor Sigaev wrote:
>
> > So, per patch status:
> > create-am
> > ready
>
> Teodor agreed to me committing this one instead of him; thanks. I just
> pushed it after some mostly cosmetic adjustments.

This was maybe too laconic. I actually changed the code a good bit.
Some of the changes:

* pg_dump support got changed to use selectDumpableAccessMethod to
compare the OID to FirstNormalOid rather than embedding "10000" in the
SQL query. This is in line with what we do for other
no-schema-qualified object types.

* I changed DROP ACCESS METHOD to use the generic DropStmt instead of
creating a new production. I find that most of the DropFooStmt
productions are useless -- we should remove them and instead merge
everything into DropStmt.

* I changed get_object_address to use get_object_address_unqualified,
just like all other object types which use no-schema-qualified object
names. This removes a screenful of code. I had to revert get_am_oid to
its original state instead of adding the "amtype" argument. I added
get_index_am_oid.

* In SGML docs (and psql help) I changed the "TYPE INDEX" literal with
"TYPE <replaceable>access_method_type</>".

* I moved OCLASS_AM to a more sensible place rather than just stuffing
it at the end of the list

* I removed more than half the includes in the new file amcmds; there
were not necessary.

* I changed this:

+ errmsg("function %s must return type \"index_am_handler\"",
+ NameListToString(handler_name)));

to this:

+ errmsg("function %s must return type \"%s\"",
+ NameListToString(handler_name),
+ "index_am_handler")));

This eases the job of translators: 1) there's no point in presenting the
type name to translate, since it cannot be translated, and 2) all the
equivalent sentences share a single translation instead of needing a
dozen separate translations that only differ in a word that cannot be
translated anyway. In doing this I noticed that most other uses do not
do this, so I'm going to change them too.

.. Oh crap. I just noticed I forgot to update a comment in pg_dump's
getAccessMethods. And we're missing psql tab-complete support for the
new commands.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2016-03-24 15:21:29 Re: [WIP] Effective storage of duplicates in B-tree index.
Previous Message Robert Haas 2016-03-24 15:14:56 Re: dealing with extension dependencies that aren't quite 'e'