-
Notifications
You must be signed in to change notification settings - Fork 78
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
Error: undefined fun 'getuid' for LibC #291
Comments
Thanks for reporting this! The username is there to mimic the default behavior of libpq where by default it'll try to connect to a database with your current user's name and using a role named after your user. I figure there are two ways forward to fix this on Windows
1 is a lot easier to do, especially without access to a windows computer and the tradeoff of being explicit doesn't feel too onerous, but for sure 2 is a nicer experience over all. What do you think? |
Here is the implementation in libpq: https://github.com/postgres/postgres/blob/7175ef870e24763a561821685160c5e35b2e8989/src/interfaces/libpq/fe-auth.c#L1186-L1245 |
Thanks for finding that @straight-shoota . Also relevant https://github.com/postgres/postgres/blob/7175ef870e24763a561821685160c5e35b2e8989/src/interfaces/libpq/fe-auth.c#L1255-L1262 where for non-windows they get the user id to call that function you linked, but for windows it's ignored and so instead hardcoded to 0. I'm not sure what Windows header file Also related, but I completely forgot but it looks like I tried to push this current user code into the crystal stdlib a while ago, but also in that PR didn't do Windows so it doesn't help much here. Still maybe this get-the-current-user does belong in stdlib? |
|
I'm ok with this solution, at least for now. It could even be updated later to support solution 2. |
Hi! I have the same issue
|
I'm working on getting Avram Windows Support and when running on Windows, I got this error
It looks like it's coming from here
crystal-pg/src/pq/conninfo.cr
Line 174 in cafeb43
This is running Crystal 1.14.0 on whatever
windows-latest
is.Maybe related: crystal-lang/crystal#12605
The text was updated successfully, but these errors were encountered: