Postgres concurrent index option no longer works

Aperta
#293 0 commenti 4 reazioni 1 assegnatario Vedi su GitHub

@jinzhu ci sta già lavorando.

Dal 9/12/2024.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

GORM Playground Link

https://github.com/go-gorm/playground/pull/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.

https://github.com/go-gorm/postgres/pull/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)

Lingua principale
Go
Stelle
298
Fork
158
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di go-gorm/postgres

Tutte le issue di go-gorm/postgres

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.