Created
July 21, 2014 22:14
-
-
Save kousu/e3b33b0485fa2879bff5 to your computer and use it in GitHub Desktop.
hacking postgres
This file contains 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
-- 1) run postgres | |
-- 2) load this into it (if postgres wasn't compiled with python support, bad things will happen) | |
CREATE LANGUAGE plpython2u; | |
DROP FUNCTION IF EXISTS b(); | |
CREATE FUNCTION b() RETURNS void AS $$ | |
print "HATCH HATCH HATCH" | |
print plpy | |
import IPython | |
IPython.embed() | |
$$ language plpython2u; | |
-- 3) go look at the postgres server stdout; this line drops the postgres server into an IPython shell | |
SELECT * from b(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm not saying this is a /good/ idea.