Check out example codes for "uninstall postgresql mac". It will help you in understanding the concepts better.

Code Example 1

$ brew remove postgresql

Code Example 2

/Library/PostgreSQL/10
open uninstall-postgres.app

Learn ReactJs, React Native from akashmittal.com