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

CREATE ... IF NOT EXISTS ... #440

Open
sroussey opened this issue Feb 8, 2025 · 0 comments
Open

CREATE ... IF NOT EXISTS ... #440

sroussey opened this issue Feb 8, 2025 · 0 comments

Comments

@sroussey
Copy link

sroussey commented Feb 8, 2025

Describe the bug

I just started using this lib, so sorry if i am doing something obviously wrong...

Very first thing I try to do is create the table:

CREATE TABLE IF NOT EXISTS ....

Below is a smaller example with CREATE TYPE IF NOT EXISTS

PostgresError: 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:

    
    CREATE TYPE IF NOT EXISTS job_status AS ENUM ('NEW', 'PROCESSING', 'COMPLETED', 'FAILED', 'ABORTING');
    ;

💀 Syntax error at line 2 col 20:

1  
2      CREATE TYPE IF NOT EXISTS job_status AS ENUM ('NEW', 'PROCESSING', 'COMPLETED', 'FAILED', 'ABORTING');
                      ^
3      ;
Unexpected kw_not token: "not". Instead, I was expecting to see one of the following:

To Reproduce

CREATE TYPE IF NOT EXISTS job_status AS ENUM ('NEW', 'PROCESSING', 'COMPLETED', 'FAILED', 'ABORTING')

pg-mem version

3.0.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant