--- a/pgtoolkit/pgbrowser.py Tue Dec 10 11:39:57 2013 +0100
+++ b/pgtoolkit/pgbrowser.py Tue Feb 04 16:10:04 2014 +0100
@@ -127,6 +127,7 @@
self.mode = mode
self.default = default
+
class Function:
def __init__(self, browser, schema, oid, name, function_name, type, result, source):
self.browser = browser
@@ -416,7 +417,7 @@
oid: function oid from pg_catalog.pg_proc (returned by list_functions)
"""
- return self._query('''select pg_get_functiondef(%s);''', [oid])
+ return self._query('''SELECT pg_get_functiondef(%s) AS definition;''', [oid])[0]['definition']
def list_types(self, schema='public'):
"""List types in schema.