Based on this question: Docker Compose variable Substitution with Quotes vs without
what, if any, is the difference between quoted and unquoted strings in yaml?
This question mainly comes from my question on variable substitution in docker compose file -which is yml.
The official example given is:
db:
image: "postgres:${POSTGRES_VERSION}"
I was wondering if this would be valid without strings:
db:
image: postgres:${POSTGRES_VERSION}
If not, then why? What are the cases where I should be adding quotes when using variable substitution in docker? How do I recognise them? What is it called -in the case I need to do further research on them in google?