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

Fix PostgreSQL sequence creation error #77

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

SoKnight
Copy link

Sometimes, when application starts again (not firstly) and tries to create non-existing tables, then executing SQL sequences without IF NOT EXISTS flag that causes an exception (see a screenshot below).

@noordawod
Copy link
Collaborator

Thanks @SoKnight, LGTM 🎉 What do you think, @j256?

@SoKnight
Copy link
Author

I compiled ORMLite JDBC jar from sources forked by me and test it.
It's working fine, see a screenshot :)

@Bo98
Copy link
Collaborator

Bo98 commented Feb 20, 2022

I don't think isCreateIfNotExistsSupported() is the correct check here. It checks if CREATE TABLE IF NOT EXISTS is supported, which is PostgreSQL 9.1 and later. CREATE SEQUENCE IF NOT EXISTS however is only supported in 9.5+.

@SoKnight
Copy link
Author

I don't think isCreateIfNotExistsSupported() is the correct check here. It checks if CREATE TABLE IF NOT EXISTS is supported, which is PostgreSQL 9.1 and later. CREATE SEQUENCE IF NOT EXISTS however is only supported in 9.5+.

Oh yes, sure, it's very important, lol...

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

Successfully merging this pull request may close these issues.

3 participants