Skip to content

Commit

Permalink
removed minor from version
Browse files Browse the repository at this point in the history
fixed server version detection for builds like "11.2 (Debian 11.2-1.pgdg90+1)"
  • Loading branch information
andboson committed Jun 13, 2020
1 parent 8ae9eea commit 4a7d987
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions conn.go
Expand Up @@ -1689,10 +1689,9 @@ func (cn *conn) processParameterStatus(r *readBuf) {
case "server_version":
var major1 int
var major2 int
var minor int
_, err = fmt.Sscanf(r.string(), "%d.%d.%d", &major1, &major2, &minor)
_, err = fmt.Sscanf(r.string(), "%d.%d", &major1, &major2)
if err == nil {
cn.parameterStatus.serverVersion = major1*10000 + major2*100 + minor
cn.parameterStatus.serverVersion = major1*10000 + major2*100
}

case "TimeZone":
Expand Down

1 comment on commit 4a7d987

@drrossum
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit seems to break pq.CopyIn operations using jsonb data, see #1023

When I revert this commit from v1.10.4 the copyin starts working again.

Please sign in to comment.