Goldman's primary decomposition and the tertiary decomposition