Created
March 27, 2019 21:12
-
-
Save fabriziomello/8cbea8bd2e618d24c9b5412fab3b696a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FUNCTION bytea_import(filename text) RETURNS bytea AS | |
$$ | |
import os | |
with open(filename, 'r') as f: | |
s = f.read() | |
return s | |
$$ | |
LANGUAGE 'plpythonu' VOLATILE; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment