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

ERROR: relation "idx_xxx" already exists (SQLSTATE 42P07) #151

Closed
microyahoo opened this issue Dec 28, 2022 · 2 comments
Closed

ERROR: relation "idx_xxx" already exists (SQLSTATE 42P07) #151

microyahoo opened this issue Dec 28, 2022 · 2 comments
Assignees

Comments

@microyahoo
Copy link

GORM Playground Link

go-gorm/playground#1

Description

2022/12/28 02:48:33 /root/go/src/deeproute.ai/smd/vendor/gorm.io/driver/postgres/migrator.go:271 ERROR: relation "idx_cephfs_subvolumes_subvolume_name" already exists (SQLSTATE 42P07)
[0.650ms] [rows:0] ALTER TABLE "cephfs_subvolumes" ADD CONSTRAINT "idx_cephfs_subvolumes_subvolume_name" UNIQUE("subvolume_name")
I1228 02:48:33.476777       1 log.go:198] ERROR: relation "idx_cephfs_subvolumes_subvolume_name" already exists (SQLSTATE 42P07)
@microyahoo
Copy link
Author

microyahoo commented Dec 28, 2022

The probability of this problem occurring at pod startup is very high. It'd better to check whether the constraint has existed or not before create it.

@microyahoo
Copy link
Author

microyahoo commented Dec 28, 2022

The fix has been merged #145. Please help to create a new tag, thanks. @jinzhu

@jinzhu jinzhu closed this as completed Jan 2, 2023
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