Yes, it's as PSY said, if using a gain pedal and a compressor - I always used to put the compressor first to add extra sustain before beefing that resulting sustain up.
My favourite is in fact the Barber 'Tone Press' - as you can blend the compressed and clean signal together. With the blend knob far left, it is just a big clean booster, - and with the blend over far right you get the compression only e.t.c.
Using the gain and blend knobs together, means that you can get a considerable volume boost with your compression. There is also an internal trim pot that takes the overall flavour from a squashy, dark Dyna-Comp sound - to a more 'open' brighter studio compression sound. I prefer the later. If you have a Strat or Telecaster , there is a great setting in the manual called " magic dust for single coils " .
Experimenting with an overdrive pedal and a compressor with added gain facility can get you some very nice extra sustain on your overdriven sound, even at low ( bedroom /practice ) volumes.
Very Dave Gilmour . :)