所以可以自定义函数
CREATE OR REPLACE FUNCTION "public"."pg_read_file_binary" (text,bigint,bigint) RETURNS bytea AS
'pg_read_file'
LANGUAGE 'internal' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER;
'pg_read_file'
LANGUAGE 'internal' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER;
安全问题
CREATE OR REPLACE FUNCTION "public"."pg_read_file_binary_s" (S_FILE text,I_SEEK bigint,I_LENGTH bigint) RETURNS bytea AS
$BODY$
DECLARE
IBIGINT;
BEGIN
I=(pg_stat_file(S_FILE)).size;
else
i=i_length;
endif
IF substr(S_FILE,5)<>'graph'
raise exception '只能读取graph目录';
end if;
return pg_read_file_binary(s_file,i_seek,i);
END
END