jackc / jackc/pgx

Why the row affected still have no zero even field in column are not updated actually same value

Open
#2,024 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
14.3k
Forks
1.1k
Avg merge
6d 9h
Merged PRs (30d)
11

Description

func (repo *wasteTypeRepo) UpdateByID(ctx context.Context, payload model.WasteTypeUpdateWithVersionRequest) error {
fmt.Println(payload.SOURCEID)
queries := repo.pgxConfig.TrOrDB(ctx)
sql := `--sql
UPDATE waste_types SET "name" = 'bar'
`

result, err := queries.Exec(ctx, sql)
fmt.Println(result.RowsAffected())

return err
}

Contributor guide

Open the contributing guide

Research direction

Start with the UpdateByID function shown in the issue and reproduce its UPDATE statement using the pgx execution path. Check the returned RowsAffected value and compare it with PostgreSQL's behavior for an update that writes the same value; done means explaining the observed result and identifying any needed documentation or code change.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, postgresql
Domain
database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.