Re: Allow GiST opcalsses without compress\decompres functions

x4mmm@yandex-team.ru

From: Andrey Borodin <x4mmm@yandex-team.ru>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Alexander Korotkov <a.korotkov@postgrespro.ru>, Dmitriy Sarafannikov <dsarafannikov@yandex.ru>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2017-10-22T11:48:20Z
Lists: pgsql-hackers

Attachments

Hi, Tom!
> 20 сент. 2017 г., в 8:38, Tom Lane <tgl@sss.pgh.pa.us> написал(а):
> 
> Andrey Borodin <x4mmm@yandex-team.ru> writes:
>> [ 0001-Allow-uncompressed-GiST-4.patch ]
> 
> Pushed, with a bit more work on the documentation and some minor
> cosmetic changes.
> 
> I did not like the fact that the new code paths added by the patch
> were untested, so I went ahead and removed the no-longer-needed
> no-op functions in the core GiST opclasses.  There's still room
> to improve the contrib opclasses, but that's much more tedious
> (you need to write an extension update script) so I didn't feel
> like messing with those now.

I was looking for a way to correctly drop compress\decompress functions from opclasses.
There are two cases: when the functions do something unnecessary (like TOASTing) and when they are just no-ops.

First case occurs, for example, in cube. Please see patch attached. There is no DROP DEFAULT and I'm doing
UPDATE pg_opclass SET opcdefault = FALSE WHERE opcname = 'gist_cube_ops';
I'm not sure it is correct way, but I haven't found any other workaround. Then I just create new default opclass without compress\decompress.

Second case, for example in seg. I have tried 
alter operator family gist_seg_ops using gist drop function 3 (seg);
It does not work: dependency between opclass and method is DEPENDENCY_INTERNAL and command is refused.
Should I create new opclass as with cube or, may be, I can delete functions from system catalog?

Best regards, Andrey Borodin.

Commits

  1. Allow no-op GiST support functions to be omitted.

  2. Remove no-op GiST support functions in the core GiST opclasses.