PG middleware for Ftybr router