fordfrog / apgdiff

Another PostgreSQL Diff Tool
http://www.apgdiff.com
MIT License
353 stars 138 forks source link

Reserved keywords in diff causing issues #286

Open syphernl opened 2 years ago

syphernl commented 2 years ago

It appears that quoted reserved keywords used as column names aren't handled properly by apgdiff:

Exception in thread "main" cz.startnet.utils.pgdiff.parsers.ParserException: Cannot find column '"time"' in table 'transaction'

This happens in 2.7.0. In 2.6.0 it would result in a NullPointerException.

bochove commented 2 years ago

The sql: GRANT UPDATE ("time") ON x.transaction TO x; leads to a pg_dump containing: GRANT UPDATE("time") ON TABLE x.transaction TO x;

pg_diff then can't find this column, but when the dump is changed to: GRANT UPDATE(time) ON TABLE x.transaction TO x; there is no longer an issue, the problem is that this is not how it is dumped. The dumped line is correct, the column does exist.