Permalink
Browse files

- Change the TRIGGER name and function detection

- Always set the search_path
  • Loading branch information...
1 parent 8189a08 commit dbc6d4b1c9292a244afd804c6a97eb9d92e20094 Sébastien Lardière committed May 29, 2012
Showing with 7 additions and 7 deletions.
  1. +1 −3 pgstaging/restore.py
  2. +6 −4 pgstaging/staging.py
View
@@ -493,14 +493,12 @@ def get_trigger_funcs(self, filename):
continue
if line.find(create_trigger) > -1:
- current_trigger = line[create_trigger_l:].strip()
+ current_trigger = line[create_trigger_l:].strip().split(' ')[0]
if current_trigger not in triggers[current_schema]:
# add an empty procedures list
triggers[current_schema][current_trigger] = []
- continue
-
if line.find(returns_trigger) > -1:
# CREATE FUNCTION partition_board_log() RETURNS "trigger"
pname = line.split()[2].strip('()')
View
@@ -466,8 +466,9 @@ def restore(self):
mesg += "\nDetail: %s" % e
raise PGRestoreFailedException, mesg
- # set the database search_path if non default
- self.set_database_search_path()
+ finally:
+ # set the database search_path if non default
+ self.set_database_search_path()
# remove the dump even when there was no exception
self.do_remove_dump(filename)
@@ -543,8 +544,9 @@ def load(self, filename):
mesg += "\nDetail: %s" % e
raise PGRestoreFailedException, mesg
- # set the database search_path if non default
- self.set_database_search_path()
+ finally:
+ # set the database search_path if non default
+ self.set_database_search_path()
return secs

0 comments on commit dbc6d4b

Please sign in to comment.