I want to drop a constraint if it exists, and not get an error if it
doesn't exist,
ideally I'd get a jdbc error code, and silence the 'consrtaint does
not exist' exception,
but since postgress doesn't send error codes to jdbc, I'd like to put
the statement in
a block and silence the exception like this
sb.append("begin \n");
sb.append("alter table " + foreingKeyTable.name + " drop
constraint " + fkName + ";\n");
sb.append("exception when true then \n");
sb.append("end;");
statement.execute(sb.toString)
It seems that this is either unsupported or I have bad syntax....
Any clues on ho to do this ?