Re: Allow GiST opcalsses without compress\decompres functions

From: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>, Dmitriy Sarafannikov <dsarafannikov(at)yandex(dot)ru>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Allow GiST opcalsses without compress\decompres functions
Date: 2017-10-22 11:48:20
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi, Tom!
> 20 сент. 2017 г., в 8:38, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> написал(а):
> Andrey Borodin <x4mmm(at)yandex-team(dot)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.

Attachment Content-Type Size
0001-Create-cube-opclass-without-compress-decompress.patch application/octet-stream 4.6 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2017-10-22 13:19:18 Re: BUG #14849: jsonb_build_object doesn't like VARIADIC calls very much
Previous Message Pavel Stehule 2017-10-22 07:56:32 Re: stalled post to mailing list - wrong filter?