Thread: Confused about extension and shared_preload_libraries

Confused about extension and shared_preload_libraries

From
Japin Li
Date:
Hi, hackers

When we write a extension using C language, we often add the dynamic library
into shared_preload_libraries, however, I found that the bloom, btree_gist and
btree_gin do not follow this rule.  I'm a bit confused with this, could anybody
explain it for me?

Thanks in advance.

-- 
Regrads,
Japin Li.
ChengDu WenWu Information Technology Co.,Ltd.



Re: Confused about extension and shared_preload_libraries

From
Aleksander Alekseev
Date:
Hi Japin,

> When we write a extension using C language, we often add the dynamic library
> into shared_preload_libraries, however, I found that the bloom, btree_gist and
> btree_gin do not follow this rule.  I'm a bit confused with this, could anybody
> explain it for me?

In the general case, you don't need to modify shared_preload_libraries to use an extension, regardless of the language in which it's implemented. That's it.

Some extensions may however require this. See the description of the GUC [1].

[1]: https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-SHARED-PRELOAD-LIBRARIES

--
Best regards,
Aleksander Alekseev

Re: Confused about extension and shared_preload_libraries

From
Japin Li
Date:
On Mon, 07 Jun 2021 at 19:25, Aleksander Alekseev <aleksander@timescale.com> wrote:
> Hi Japin,
>
>> When we write a extension using C language, we often add the dynamic
> library
>> into shared_preload_libraries, however, I found that the bloom,
> btree_gist and
>> btree_gin do not follow this rule.  I'm a bit confused with this, could
> anybody
>> explain it for me?
>
> In the general case, you don't need to modify shared_preload_libraries to
> use an extension, regardless of the language in which it's implemented.
> That's it.
>

Thanks for your explanation.

> Some extensions may however require this. See the description of the GUC
> [1].
>
> [1]:
> https://www.postgresql.org/docs/13/runtime-config-client.html#GUC-SHARED-PRELOAD-LIBRARIES

Sorry for my poor reading of the documentation.


-- 
Regrads,
Japin Li.
ChengDu WenWu Information Technology Co.,Ltd.