Never edit files installed by a package manager. They get overridden with every update. Only few files in /etc/ will get a pacnew ending.
Either create an override file, ( sudo systemctl edit postgresql.service ) or copy the complete file to /etc/systemd/system and make your necessary changes. After copy and edit do a systemctl daemon-reload .
An alternative would be to do sudo systemctl edit -all postgresql.service (only one dash in front of all) , make the changes and save. Wich is basically the same as to copy the file in /etc/systemd/system and make changes.
Just for my understanding (Sorry, never heard about that way before): The command sudo systemctl edit postgresql.service copies the file, each line marked as comment with initial #? Now I edit the change uncomment that line and save the file. And the system will care about the override by its own?
Just edit (without -all) will not copy anything. The comments are just for you and will not be in the override file. Don’t forget to also specify the correct section. This needs to be in override file as well.
The created override file will be shown in the status output as used in combination with the system service file.