lelit/pglast

Duplicate `DEFERRABLE INITIALLY DEFERRED` in output

Closed this issue · 3 comments

Consider the following example where DEFERRABLE INITIALLY DEFERRED appears twice in the output. This happens in 5.3 but seems to be present in older versions too as far back as 3.5.

Python 3.11.3 (main, Jun  5 2023, 09:32:32) [GCC 13.1.1 20230429] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pglast import prettify
>>> prettify("ALTER TABLE tab1 ADD CONSTRAINT foo FOREIGN KEY (id1) REFERENCES tab2 (id2) DEFERRABLE INITIALLY DEFERRED")
'ALTER TABLE tab1 ADD CONSTRAINT foo FOREIGN KEY (id1) REFERENCES tab2 (id2) DEFERRABLE INITIALLY DEFERRED DEFERRABLE INITIALLY DEFERRED'

Thanks again for the report, this kind of defects is harder to catch in the test suite 😭

This should be fixed as well, in just released v3, v4 and v5!

Great work, thanks!