Fix postgresql upgrade script wrt sequences

The upgrade script tried to re-create the sequences even if it was already
existing. It turns out that the name `foo;` was compared to `foo` because the
query is actually `CREATE SEQUENCE foo;`. Adjust the regex to ignore the `;`.