Skip to content

# is not as -- in PostgreSQL #1646

Description

@rox72000-art

pgcli interprets # as a comment mark like -- whereas that is it a XOR operator of binary numbers in PostgreSQL.

Activity

  1. dbaty commented on Sep 21, 2026

    @dbaty
    Member

    You are correct. Reproduction:

    > select 17 # 5;
    +----------+
    | ?column? |
    |----------|
    | 17       |
    +----------+
    

    Result should be 20 (see PostgreSQL documentation).

    This is a known (and old) limitation of one of pgcli dependencies, sqlparse : andialbrecht/sqlparse#539.

  2. rox72000-art commented on Sep 21, 2026

    @rox72000-art
    Author

    pgcli should parse the statement before giving it to sqlparse. Not sure il will be enough to fix the problem.

  3. DiegoDAF commented on Sep 21, 2026

    @DiegoDAF
    Contributor

    ship! my bad!

  4. added a commit that references this issue on Sep 21, 2026
    2c08154
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions