Skip to content

Commit

Permalink
0000863: When testing to see if a symmetric trigger exists on postgre…
Browse files Browse the repository at this point in the history
…s, also check for the existence of the function
  • Loading branch information
chenson42 committed Oct 19, 2012
1 parent ba25e87 commit 09d9b18
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -98,7 +98,10 @@ public boolean requiresAutoCommitFalseToSetFetchSize() {
protected boolean doesTriggerExistOnPlatform(String catalogName, String schema, String tableName, String triggerName) {
return platform.getSqlTemplate().queryForInt("select count(*) from information_schema.triggers where trigger_name = ? "
+ "and event_object_table = ? and trigger_schema = ?", new Object[] { triggerName.toLowerCase(),
tableName, schema == null ? platform.getDefaultSchema() : schema }) > 0;
tableName, schema == null ? platform.getDefaultSchema() : schema }) > 0 ||
platform.getSqlTemplate().queryForInt("select count(*) from information_schema.routines where routine_name = ? "
+ "and routine_schema = ?", new Object[] { "f" + triggerName.toLowerCase(),
schema == null ? platform.getDefaultSchema() : schema }) > 0;
}

@Override
Expand Down

0 comments on commit 09d9b18

Please sign in to comment.