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

[Bug] Table creation failed via cursor.execute func #4

Open
DjangoPeng opened this issue Feb 11, 2023 · 5 comments
Open

[Bug] Table creation failed via cursor.execute func #4

DjangoPeng opened this issue Feb 11, 2023 · 5 comments

Comments

@DjangoPeng
Copy link
Contributor

An error occurred when I want to create a table via cursor.execute function.

You can reproduce as below:

conn.create_database("tf_demo")
conn.switch_database("tf_demo")
print(conn.list_database())
        
cursor.execute(f"CREATE TABLE [IF NOT EXISTS] sunspot (date STRING, mssn DOUBLE,);")
ERROR:root:Invalid syntax or Object not exists, get ERROR from database : HTTP Error 422: Unprocessable Entity
[{'Database': 'public'}, {'Database': 'tf_demo'}]
@DjangoPeng
Copy link
Contributor Author

@Subsegment

@yukkit
Copy link

yukkit commented Feb 11, 2023

Maybe you can remove the square brackets around “if not exists” and retry

@DjangoPeng
Copy link
Contributor Author

image

@DjangoPeng
Copy link
Contributor Author

Actually it's make me confused after removing [].

So I opened an issue of cnosdb syntax here cnosdb/cnosdb#910

@yukkit
Copy link

yukkit commented Feb 11, 2023

Thank you very much, we will optimize our documentation and error messages

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

2 participants