thread-chunk-postgresql.xql