Skip to content

Commit

Permalink
fix(psql-max): pagination fails using uuid field derived cursors (#503)
Browse files Browse the repository at this point in the history
Co-authored-by: LucaWolf <[email protected]>
  • Loading branch information
LucaWolf and LucaWolf authored May 3, 2024
1 parent 22ad194 commit b56566b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/internal/psql/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,10 @@ func (c *compilerContext) renderPluralSelect(sel *qcode.Select) {
for i := 0; i < len(sel.OrderBy); i++ {
c.w.WriteString(`, MAX(__cur_`)
int32String(c.w, int32(i))
// Postgres rejects MAX(uuid)
if sel.OrderBy[i].Col.Type == "uuid" {
c.w.WriteString(`::text`)
}
c.w.WriteString(`)`)
// c.w.WriteString(`, CAST(MAX(__cur_`)
// int32String(c.w, int32(i))
Expand Down

0 comments on commit b56566b

Please sign in to comment.