Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
+23
@@ -0,0 +1,23 @@
|
||||
-- # $Id$
|
||||
-- # $HeadURL$
|
||||
-- # $Author$
|
||||
|
||||
CREATE FUNCTION bytea_import(p_path text, OUT p_result bytea) RETURNS bytea
|
||||
LANGUAGE plpgsql
|
||||
AS $$
|
||||
|
||||
DECLARE
|
||||
l_oid oid;
|
||||
r record;
|
||||
|
||||
BEGIN
|
||||
|
||||
p_result := '';
|
||||
SELECT lo_import(p_path) INTO l_oid;
|
||||
for r in ( SELECT data FROM pg_largeobject WHERE loid = l_oid ORDER BY pageno ) loop
|
||||
p_result = p_result || r.data;
|
||||
end loop;
|
||||
perform lo_unlink(l_oid);
|
||||
|
||||
END;$$;
|
||||
|
||||
Reference in new issue
Block a user