I'm not familiar with postgres, but I found this issue. I think you should use it like in the godoc
Example in godoc
age := 21
rows, err := db.Query("SELECT name FROM users WHERE age = $1", age)
(Replace "?" with "$n")
Your code
func (c App) ViewPosts(page int) revel.Result {
if page == 0 {
page = 1
}
var posts []*models.Post
size := 10
posts = loadPosts(c.Txn.Select(models.Post{},
`select * from posts offset $1 limit $2`, (page-1)*size, size))
return c.RenderJson(posts)
}