通过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

猜你喜欢

转载自www.cnblogs.com/rongfengliang/p/11829483.html