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

Postgres concurrent index option no longer works #293

Open
dashrews78 opened this issue Dec 9, 2024 · 0 comments
Open

Postgres concurrent index option no longer works #293

dashrews78 opened this issue Dec 9, 2024 · 0 comments
Assignees

Comments

@dashrews78
Copy link

GORM Playground Link

go-gorm/playground#778

Description

Trying to create a Postgres index concurrently. Followed the directions from the docs https://gorm.io/docs/indexes.html by adding ,options:CONCURRENTLY. This resulted in an error creating the table.

#288 causes CONCURRENTLY to be appended to the end of the create index command. This is clearly invalid. That change did not test the case for CONCURRENTLY and thus didn't find that it is now broken.

So I reproduced it the playground to only run Postgres. I added an index to one of the fields in the model. As you can see from the results the same error was received.

2024/12/09 15:39:33 /home/runner/go/pkg/mod/gorm.io/driver/[email protected]/migrator.go:153 ERROR: syntax error at or near "CONCURRENTLY" (SQLSTATE 42601)
[0.342ms] [rows:0] CREATE INDEX CONCURRENTLY IF NOT EXISTS "owner_id" ON "toys" USING btree("owner_id") CONCURRENTLY
2024/12/09 15:39:33 Failed to auto migrate, but got error ERROR: syntax error at or near "CONCURRENTLY" (SQLSTATE 42601)

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