We investigate the populations of main-sequence stars within 25 pc that have debris discs and/or giant planets detected by Doppler shift. The metallicity distribution of the debris sample is a very close match to that of stars in general, but differs with >99 per cent confidence from the giant planet sample, which favours stars of above average metallicity. This result is not due to differences in age of the two samples. The formation of debris-generating planetesimals at tens of au thus appears independent of the metal fraction of the primordial disc, in contrast to the growth and migration history of giant planets within a few au. The data generally fit a core accumulation model, with outer planetesimals forming eventually even from a disc low in solids, while inner planets require fast core growth for gas to still be present to make an atmosphere.