通过ALTER DATABASE postgres SET 解决 plv8 plv8.start_proc 问题

Posted rongfengliang

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了通过ALTER DATABASE postgres SET 解决 plv8 plv8.start_proc 问题相关的知识,希望对你有一定的参考价值。

通过plv8.start_proc 我们可以使用类似钩子的改变 ,方便的扩展plv8,比如基于plv8.start_proc
的require 实现

命令

ALTER DATABASE postgres SET "plv8.start_proc" TO "v8.plv8_init";

说明

默认我们需要在建立连接的时候配置,一般如下:

SET plv8.start_proc = ‘v8.plv8_init‘;

通过ALTER DATABASE postgres SET 我们就为每个session 配置了自动的变量,不需要代码调整了。
同时我们编写sql 也就会很简单了

参考资料

https://www.postgresql.org/docs/9.1/sql-alterdatabase.html

以上是关于通过ALTER DATABASE postgres SET 解决 plv8 plv8.start_proc 问题的主要内容,如果未能解决你的问题,请参考以下文章