#NEWLINE# def unload_ext( self , name , sqlfile ) : #NEWLINE# #INDENT# logger . debug ( _ ( "unloading extension '%s' with file: %s" ) , name , sqlfile ) #NEWLINE# if ( sqlfile and ( not sqlfile . endswith ( '.sql' ) ) ) : #NEWLINE# #INDENT# logger . info ( _ ( "the specified file '%s' doesn't seem SQL: assuming '%s' is not a PostgreSQL extension" ) , sqlfile , name ) #NEWLINE# return #NEWLINE# #UNINDENT# pgver = self . get_pg_version ( ) #NEWLINE# if ( pgver >= ( 9 , 1 , 0 ) ) : #NEWLINE# #INDENT# if self . is_extension ( name ) : #NEWLINE# #INDENT# self . drop_extension ( name ) #NEWLINE# return #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . confirm ( ( _ ( "The extension '%s' doesn't contain a control file:\nwill look for an SQL script to unload the objects.\nDo you want to continue?" ) % name ) ) #NEWLINE# #UNINDENT# #UNINDENT# if ( not sqlfile ) : #NEWLINE# #INDENT# sqlfile = ( name + '.sql' ) #NEWLINE# #UNINDENT# tmp = os . path . split ( sqlfile ) #NEWLINE# sqlfile = os . path . join ( tmp [ 0 ] , ( 'uninstall_' + tmp [ 1 ] ) ) #NEWLINE# fn = self . find_sql_file ( name , sqlfile ) #NEWLINE# self . confirm ( ( _ ( "In order to unload the extension '%s' looks like you will have\nto load the file '%s'.\nDo you want to execute it?" ) % ( name , fn ) ) ) #NEWLINE# data = self . patch_for_schema ( fn ) #NEWLINE# self . load_sql ( data = data )