Skip to content
This repository has been archived by the owner on Jan 4, 2021. It is now read-only.

pllu.init - module #66

Open
hellower opened this issue Jan 19, 2018 · 0 comments
Open

pllu.init - module #66

hellower opened this issue Jan 19, 2018 · 0 comments

Comments

@hellower
Copy link

hellower commented Jan 19, 2018

I am very grateful for the pllua module.

Should I insert only the pllua"U" module at pllua.init table?
plla"U" module is not allowed in pllua.init table

ex)
luarocks install http -- this modue inclde "IO" module. --- untrusted!

sql> insert into pllua.init values('http.request');
sql>
CREATE OR REPLACE FUNCTION f_debug()
RETURNS integer AS
$BODY$
return 1234;
$BODY$
LANGUAGE plluau;

ERROR: /opt/PostgreSQL/luarocks//share/lua/5.1/compat53/module.lua:14: attempt to index local 'io' (a nil value)
********** Error **********

-------------- /opt/PostgreSQL/luarocks//share/lua/5.1/compat53/module.lua -------------
$ cat /opt/PostgreSQL/luarocks//share/lua/5.1/compat53/module.lua|more
local _G, _VERSION = _G, _VERSION
local lua_version = _VERSION:sub(-3)

local M = _G

if lua_version < "5.3" then

-- cache globals in upvalues
local error, ipairs, pairs, pcall, require, select, setmetatable, type =
error, ipairs, pairs, pcall, require, select, setmetatable, type
local debug, io, math, package, string, table =
debug, io, math, package, string, table
local io_lines = io.lines <-------------------------- this line !!!!
local io_read = io.read
local unpack = lua_version == "5.1" and unpack or table.unpack

.........

----------- http module dependencies-------------------
https://github.com/daurnimator/lua-http
Dependencies
cqueues >= 20161214
luaossl >= 20161208
basexx >= 0.2.0
lpeg
lpeg_patterns >= 0.3
fifo
To use gzip compression you need one of:
lzlib or lua-zlib
If using lua < 5.3 you will need
compat-5.3 >= 0.3 ------------------ !!!!
If using lua 5.1 you will need
luabitop (comes with LuaJIT) or a backported bit32_

-- my suggestion ----------------------------

CREATE TABLE pllua.init
(
module text
,trusted boolean -- new column
);
insert into pllua.init values('http.client, false);

sorry for poor english.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant