hasura / hasura/graphql-engine
SQL Execution Failed postgres-error: syntax error at or near "\"
- Dominant language
- TypeScript
- Stars
- 32.1k
- Forks
- 3k
- PR merge metrics
- PR metrics pending
Description
### 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?
Contributor guide
Research direction
Start by reproducing the issue with a tab character in a SQL migration script and trace the migration SQL execution path. Confirm the failure against PostgreSQL and verify that the same migration succeeds with tabs preserved, without breaking existing migration behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100