Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set PGOCaml_config.default_unix_domain_socket_dir during runtime #14

Open
rgrinberg opened this issue Nov 3, 2015 · 2 comments
Open

Comments

@rgrinberg
Copy link
Contributor

It seems like this variable is being set at build time but that leads to confusing behavior where if you install postgres AFTER installing pgocaml then the value will be wrong.

Can this check be moved to the runtime and wrapped with a lazy block or something to avoid stuff like this?

@darioteixeira
Copy link
Owner

Note that the most reliable solution is to always explicitly provide the unix_domain_socket_dir parameter of the connect function. The default value being set at compile time with some Makefile magic is indeed a bit of a hack: it does not work for all scenarios (like the one you mention), but it's a good-enough-default for most users. The problem with moving it to runtime is that we'll need functions to read the filesystem, which will complicate the whole monadic IO approach.

@rgrinberg
Copy link
Contributor Author

IMO doing this check in a blocking fashion is harmless. But I can do it in my own code just as well. This is quite counter-intuitive behavior though so it should be noted somewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants