go-gorm / playground

GORM Playground (Please Create PR for this project to report issues)
MIT License
89 stars 681 forks source link

'table name specified more than once' postgres error #746

Open ajhodges opened 3 months ago

ajhodges commented 3 months ago

Explain your user case and expected results

This is a test case for the issue described in https://github.com/go-gorm/gorm/issues/7055

Using this branch: GORM_DIALECT=postgres go test

Output:

[0.864ms] [rows:1] UPDATE "users" SET "name"='jinzhu 2',"updated_at"='2024-06-24 15:41:25.207' FROM "users" WHERE id = 1 AND "users"."deleted_at" IS NULL AND "users"."id" = 1 AND "id" = 1
--- FAIL: TestGORM (0.00s)
    main_test.go:22: Failed, got error: ERROR: table name "users" specified more than once (SQLSTATE 42712)