Project

General

Profile

« Previous | Next » 

Revision 2446

sql.py: Functions that version created tables, functions, etc. if they already exist: Use (default) exc_log_level=4 to hide the unsuccessful attempts to create items that already exist and show only the successful attempt

View differences:

lib/sql.py
415 415
        assert isinstance(into, sql_gen.Table)
416 416
        
417 417
        kw_args['recover'] = True
418
        kw_args.setdefault('exc_log_level', kw_args.get('log_level', 2) + 2)
419
            # by default, will have exc_log_level=4
418 420
        
419 421
        temp = not db.debug # tables are created as permanent in debug mode
420 422
        # "temporary tables cannot specify a schema name", so remove schema
......
564 566
    LANGUAGE sql
565 567
    AS $$'''+mogrify(db, query, params)+''';$$;
566 568
'''
567
                run_query(db, function_query, recover=True, cacheable=True)
569
                run_query(db, function_query, recover=True, cacheable=True,
570
                    exc_log_level=4)
568 571
                break # this version was successful
569 572
            except DuplicateFunctionException, e:
570 573
                function_name = next_version(function_name)

Also available in: Unified diff