Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

normalize_query syntax problems (lisibility) #14

Open
legrandlegrand opened this issue Mar 13, 2020 · 0 comments
Open

normalize_query syntax problems (lisibility) #14

legrandlegrand opened this issue Mar 13, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@legrandlegrand
Copy link
Owner

legrandlegrand commented Mar 13, 2020

Each exemple can be verified with pgssp_normalize_query() function.

  1. minus sign "-" is removed more than expected:
    select +1.1, -2, 2-1, b-a, b-1
    SELECT +?, ?, ?-?, ba, b?

  2. parenthesis "(" ")" are removed more than expected:
    insert into a values (null)
    INSERT INTO a VALUES ?
    or
    select f(1)
    SELECT f?

  3. Blank is missing:
    select a from t where b=2 order by c
    SELECT a FROM t WHERE b=?ORDER BY c

  4. non quoted identifiers are case sensitive (they should be lowercase):
    select aB,AB,ab,Ab,"xYz","Xyz" from t
    SELECT aB,AB,ab,Ab,"xYz","Xyz" FROM t

  5. variables from replaced literals should be typed:
    select 1, 1.1, 'aa'
    SELECT ?, ?, ?
    (this opens others questions about NULL consideration ...)

  6. following functions are not common litterals, they should not by replaced:
    select CURRENT_DATE, CURRENT_TIME, LOCALTIME, LOCALTIMESTAMP
    SELECT ?, ?, ?, ?

@legrandlegrand legrandlegrand added the enhancement New feature or request label May 10, 2020
@legrandlegrand legrandlegrand self-assigned this May 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant