We explicitly compute the sojourn time distribution of an arbitrary customer in an M/M/1 processor sharing (PS) queue with permanent customers. We notably exhibit the orthogonal structure associated with this queuing system and we show how sieved Pollaczek polynomials and their associated orthogonality measure can be used to obtain an explicit representation for the complementary cumulative distribution function of the sojourn time of a customer. This explicit formula subsequently allows us to compute the two first moments of this random variable and to study the asymptotic behavior of its distribution. The most salient result is that the decay rate depends on the load of the system and the number K of permanent customers. When the load is above a certain threshold depending on K, the decay rate is identical to that of a regular M/M/1 PS queue.