Skip to content

POSTGRES: Covering index fails when more than one field is provided in INCLUDE statement #7707

@lcucurachi

Description

@lcucurachi

GORM Playground Link

go-gorm/playground#843

Description

On POSTGRES:
I want to create a covering index on "created_at" field, and add "email" to that index with some include fields like "status" and "friendly" (I've made up the names here).

Gorm fails to create the table in the postgres database. It seems that it fails on creating the right SQL command.

If I only include one field like "status" then Gorm creates the table and the index correctly.

NOTE: Why does the go.mod file in the playground codebase try to pull "gorm.io/cmd/gorm" which does not exist?
If i delete this line from the go.mod file then it all runs fine. This issue is showing on GitHub Actions too. There is also another issue with the version of github actions which is preventing my PR tests from running. Is anyone actively working on the playground codebase? I have pushed some changes that make the postgres tests run correctly, you can check the error there for the issue I am facing with covering index on postgres.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions