Fix for #2247 | Use correct column when calculating next sequence value

See #2247 for more details.
Correctly identifier quote column names before adding them to queries.

Closes #2248
Merge branch 'postgres-sequence'

Merge changes for pull request #2248