diff --git a/values.go b/values.go index 395b59ce..ff2dfbfb 100644 --- a/values.go +++ b/values.go @@ -3022,6 +3022,12 @@ func decodeAclItemArray(vr *ValueReader) []AclItem { } str := vr.ReadString(vr.Len()) + + // short-circuit empty array + if str == "{}" { + return []AclItem{} + } + // remove the '{' at the front and the '}' at the end str = str[1 : len(str)-1] strs := strings.Split(str, ",") diff --git a/values_test.go b/values_test.go index 17a98197..4cbe40ea 100644 --- a/values_test.go +++ b/values_test.go @@ -662,6 +662,9 @@ func TestAclArrayDecoding(t *testing.T) { tests := []struct { query []pgx.AclItem }{ + { + []pgx.AclItem{}, + }, { []pgx.AclItem{"=r/postgres"}, },