If you want Traccar on one server and the database on another server, yes... it is possible!
On the Traccar server: you need to change the configuration file and you can find the documentation at
https://www.traccar.org/configuration-file/
https://www.traccar.org/postgresql/
https://www.traccar.org/forums/forum/server/
On the database server, you need to look in its documentation on how to make the service listen to external requests instead of just localhost (as I do in MySQL, I can't say the right direction, but just look...)
And finally if you are self-hosting and each of the servers are in separate places, you will need to look into network protocols and port forwarding (firewall)... remembering that your internet provider must provide a link capable of these services.
I am using postgresql db for traccar it work , but it's using public schema . I want to keep the traccar db into separate schema . How can we configure this and where can we set this settings ? is it even possible ?