What is the best way of starting pg
?
- Manually calling
pg:start_link()
? - Inside the top supervisor?
- Through kernel config by setting
{start_pg, true}
?
Problem by using {start_pg, true}
:
{shell, [
{apps, [my_app]},
{config, "./config/my.config"}
]}.
Inside my.config i have:
{kernel, [{start_pg, true}]},
I noticed that if I start pg
with kernel config, rebar3 shell
does not have pg
running.
Although i can clearly match true = application:get_env(kernel, start_pg).
If i release with the same config i have pg
running, so the option works.
Is rebar3 already starting kernel before evaluating the config ?
If so, why does it handle stuff like logger configurations and not other settings as start_pg?
Ultimately, how can i have pg running both in shell and in release in the most clean way?