forked from csimsek/pgsql-fio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfio--1.0.sql
26 lines (25 loc) · 1005 Bytes
/
fio--1.0.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION fio" to load this file. \quit
CREATE OR REPLACE FUNCTION fio_writefile(pathname varchar, content bytea, mkdir boolean default false)
RETURNS integer
AS 'MODULE_PATHNAME', 'fio_writefile'
LANGUAGE 'c';
CREATE OR REPLACE FUNCTION fio_readfile(pathname varchar)
RETURNS bytea
AS 'MODULE_PATHNAME', 'fio_readfile'
LANGUAGE 'c';
CREATE TYPE readdirresult AS (
dirname varchar
);
CREATE OR REPLACE FUNCTION fio_readdir(pathname varchar, pattern varchar default '*')
RETURNS SETOF readdirresult
AS 'MODULE_PATHNAME', 'fio_readdir'
LANGUAGE 'c';
CREATE OR REPLACE FUNCTION fio_mkdir(pathname varchar, mode varchar, recursive boolean default false)
RETURNS integer
AS 'MODULE_PATHNAME', 'fio_mkdir'
LANGUAGE 'c';
CREATE OR REPLACE FUNCTION fio_chmod(pathname varchar, mode varchar)
RETURNS integer
AS 'MODULE_PATHNAME', 'fio_chmod'
LANGUAGE 'c';