cast ttl to text for postgresql