Skip to content

postgress POWER operator parenthesis missing #4982

@Magolor

Description

@Magolor

sqlglot==26.14.0

Dialect:

sqlglot.transpile(sql, read='postgres', write="postgres", identify=True, pretty=True, comments=True)

Input SQL:

SELECT POWER(64, 1/2) LIMIT 1000

Expected:

SELECT
  64 ^ (1 / 2)
LIMIT 1000
-- result = 8.0

Result:

SELECT
  64 ^ 1 / 2
LIMIT 1000
-- result = 32.0

Official Document:
https://www.postgresql.org/docs/15/functions-math.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions