sqlparse icon indicating copy to clipboard operation
sqlparse copied to clipboard

Multi-character operators containing @, * are treated indivdually

Open yogeshmahajan-1903 opened this issue 4 years ago • 3 comments

SELECT ARRAY[1] <@ ARRAY[1, 2], 'a' !~* 'xyz'

When above sql is formatted using sqlparse.format(use_space_around_operators=true), out put is -

SELECT ARRAY[1] < @ ARRAY[1, 2], 'a' !~ * 'xyz' Spaces are added between '<' and '@' & '~' and '*'.

Probable fix would be allowing another parameter to sqlparse.format() which allows to pass explicit list of operators.

yogeshmahajan-1903 avatar Mar 30 '21 11:03 yogeshmahajan-1903

Please don't tamper with white spaces between operator characters mentioned here in the PostgreSQL documentation.

limpus64 avatar May 13 '21 18:05 limpus64

Any update on this ? Waiting for the fix.

adityatoshniwal avatar Feb 04 '22 11:02 adityatoshniwal