oguimbal / pg-mem

An in memory postgres DB instance for your unit tests
MIT License
1.98k stars 97 forks source link

error with transaction: SET SESSION CHARACTERISTICS AS TRANSACTION READ ONLY;; #404

Open GGAlanSmithee opened 4 months ago

GGAlanSmithee commented 4 months ago

Describe the bug

When attempting to run a query in a transaction,

QueryError: 💔 Your query failed to parse.
This is most likely due to a SQL syntax error. However, you might also have hit a bug, or an unimplemented feature of pg-mem.
If this is the case, please file an issue at https://github.com/oguimbal/pg-mem along with a query that reproduces this syntax error.

👉 Failed query:

    SET SESSION CHARACTERISTICS AS TRANSACTION READ ONLY;;

💀 Syntax error at line 1 col 29:

1  SET SESSION CHARACTERISTICS AS TRANSACTION READ ONLY;;
                               ^
Unexpected kw_as token: "as". Instead, I was expecting to see one of the following:

    - A "op_eq" token
    - A "kw_to" token

To Reproduce


SET SESSION CHARACTERISTICS AS TRANSACTION READ ONLY;;

pg-mem version

"version": "2.8.1"