Peel the pumpkin and cut into cubes or medium thick pieces -it will lose volume- as explained here. Fry in a pan with oil or roast in the oven at 180ºC until tender but not falling apart. Let cool.
Wash the celery stalks, cut the ends that are ugly, remove the filaments and cut in half to have eight pieces. Bring water to boil and cook celery 4-5 minuteswithout letting it get too soft. Drain and cool quickly; cut into bite-sized pieces and reserve.
Cut the onion into feathers or julienne and poach in a pan with two or three tablespoons of oil and a little salt, until tender. Add the tomato, stir well and cook until slightly reduced and loses water, about 10-15 minutes. If passata is used, 3-4 minutes and less will suffice.
Add the drained capers, olives and pine nuts, stirring well. Add the sugar and vinegar, stir and cook over low heat for a few minutes. taste the sauce and adjust the flavor to taste, correcting sugar, salt or vinegar if necessary.
Turn off the fire and add the celery and pumpkin, stirring gently to incorporate everything well. Transfer to a suitable source or container and allow to cool before covering and storing in the fridge to rest for several hours.