Context. An important ingredient in binary evolution is the common-envelope (CE) phase. Although this phase is believed to be responsible for the formation of many close binaries, the process is not well understood. Aims. We investigate the characteristics of the population of post-common-envelope binaries (PCEB). As the evolution of these binaries and their stellar components are relatively simple, this population can be directly used to constraint CE evolution. Methods. We use the binary population synthesis code SeBa to simulate the current-day population of PCEBs in the Galaxy. We incorporate the selection effects in our model that are inherent to the general PCEB population and that are specific to the SDSS survey, which enables a direct comparison for the first time between the synthetic and observed population of visible PCEBs. Results. We find that selection effects do not play a significant role on the period distribution of visible PCEBs. To explain the observed dearth of long-period systems, the {alpha}-CE efficiency of the main evolutionary channel must be low. In the main channel, the CE is initiated by a red giant as it fills its Roche lobe in a dynamically unstable way. Other evolutionary paths cannot be constrained more. Additionally our model reproduces well the observed space density, the fraction of visible PCEBs amongst white dwarf (WD)- main sequence (MS) binaries, and the WD mass versus MS mass distribution, but overestimates the fraction of PCEBs with helium WD companions.