Revision 3443
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql.py | ||
---|---|---|
829 | 829 |
while True: |
830 | 830 |
try: |
831 | 831 |
function = db.TempFunction(function_name) |
832 |
def_ = sql_gen.FunctionDef(function, return_type, query, lang) |
|
832 | 833 |
|
833 |
function_query = '''\ |
|
834 |
CREATE FUNCTION '''+function.to_str(db)+'''() |
|
835 |
RETURNS SETOF '''+return_type+''' |
|
836 |
LANGUAGE '''+lang+''' |
|
837 |
AS $$ |
|
838 |
'''+query+''' |
|
839 |
$$; |
|
840 |
''' |
|
841 |
run_query(db, function_query, recover=True, cacheable=True, |
|
834 |
run_query(db, def_.to_str(db), recover=True, cacheable=True, |
|
842 | 835 |
log_ignore_excs=(DuplicateException,)) |
843 | 836 |
break # this version was successful |
844 | 837 |
except DuplicateException, e: |
Also available in: Unified diff
sql.py: mk_insert_select(): embeddable: Use new sql_gen.FunctionDef