hasura / graphql-engine

Blazing fast, instant realtime GraphQL APIs on your DB with fine grained access control, also trigger webhooks on database events.
https://hasura.io
Apache License 2.0
31.09k stars 2.77k forks source link

SQL Execution Failed postgres-error: syntax error at or near "\" #7806

Open jcmoore0 opened 2 years ago

jcmoore0 commented 2 years ago

Version Information

Server Version: v2.0.10 CLI Version (for CLI related issue): v2.0.9

Environment

GCP GKE

What is the expected behaviour?

no error when tab characters in migration SQL

Keywords

SQL Execution Failed postgres-error: syntax error at or near "\"

What is the current behaviour?

SQL Migration Execution Fails when a tab character '\t' is inside the script Migration execution succeeds when removing all \t. Previous Hasura versions allowed tab characters in SQL script. When I 'modify' tracked functions, they will fail until I search and remove all \t.

How to reproduce the issue?

  1. Put a tab character in a SQL Migration Script

Screenshots or Screencast

Please provide any traces or logs that could help here.

{
    "internal": {
        "statement": "CREATE OR REPLACE FUNCTION  something() \nreturns setof ....
        "prepared": false,
        "error": {
            "exec_status": "FatalError",
            "hint": null,
            "message": "syntax error at or near \"\\\"",
            "status_code": "42601",
            "description": null
        },
        "arguments": []
    },
    "path": "$[0]",
    "error": "query execution failed",
    "code": "postgres-error"
}

Any possible solutions?

Can you identify the location in the source code where the problem exists?

If the bug is confirmed, would you be willing to submit a PR?

abdullah2993 commented 2 years ago

related to https://github.com/hasura/graphql-engine/issues/7362