-
Notifications
You must be signed in to change notification settings - Fork 26
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
can you make a setup for pg12 on windows systems? #40
Comments
Hi, Unfortunately this is out of my knowledge. I don't have a windows system and didn't use one in more than a decade, so I'm not in a position to do it. If you have a windows system, you could maybe try https://wiki.postgresql.org/wiki/Building_and_Installing_PostgreSQL_Extension_Modules or https://www.2ndquadrant.com/en/blog/compiling-postgresql-extensions-visual-studio-windows/. Note that I'll be happy to fix any problem this may undercover with the source code (it will likely have issue with missing PGDLLEXPORT, maybe other things). |
Hi, playing with compilation on windows as advised here: https://wiki.postgresql.org/wiki/Building_and_Installing_PostgreSQL_Extension_Modules Severity Code Description Project File Line Suppression State Otherwise, the compilation goes fine. |
@suprimex thanks a lot for looking at it! Unfortunately the problem with |
@suprimex I just pushed a fix_windows branch (https://github.com/powa-team/pg_qualstats/tree/fix_windows) that should fix at least this issue. Is that enough to allow compilation on Windows? |
Thanks, @rjuju now it is compiled without errors. |
p.s. (quote) You should also add a prototype marked PGDLLEXPORT for the function so that MSVC knows to export its symbol: PGDLLEXPORT Datum <your_function_name>(PG_FUNCTION_ARGS); /* << like this*/ |
Thanks for checking the patch. For the PGDLLEXPORT, I thought that PG_FUNCTION_INFO_V1 would take care of that. But looking twice it's actually doing half the work unfortunately, as seen in https://github.com/postgres/postgres/blob/master/src/include/fmgr.h#L417:
So I'm assuming that I have to do it for all the functions declared as PG_FUNCTION_INFO_V1()? Do you know if other things need it too (like maybe the GUC variables)? |
yes, I just added: But now, I assume, there is something wrong with the mechanism which detecting how the library was loaded. |
Building on windows shouldn'thave any impact on this I think. The error message is not really accurate anymore though, as pg_qualstats can also be used in a "stand alone" mode. Did you restart postgres after compiling and changing the shared_preload_libraries? Is it working it you do something like:
|
Sure ;-) restarted. SET pg_qualstats.sample_rate = 1; from log: 2021-07-27 13:06:05.556 EEST [25760] ERROR: 55000: pg_qualstats must be loaded via shared_preload_libraries |
I see. It seems that your first guess was correct: compilation works fine but somehow the loading code isn't executed. The _PG_init (and _PG_fini) functions are explicitly called after dynamically loading the shared library, so I'm assuming that a PGDLLEXPORT is also required there. I pushed another commit to add all those missing annotations (331ee73). Does it solve all the remaining problems? |
Thanks to @suprimex help we could fix all issues with Windows environment. I just merged the commits on the master branch, which should now compile cleanly and work as intended on Windows! |
Hi @gdonufrio I spent some time setting up a build environment on Windows. Does this archivework for you? It should be extracted in the root folder of your postgres 12 installation. |
Thank you very much ,
That is amazing Julien .
I will try tomorrow when I will return from Hollidays
Gabriele
Il giorno dom 15 ago 2021 alle 13:47 Julien Rouhaud <
***@***.***> ha scritto:
… Hi @gdonufrio <https://github.com/gdonufrio>
I spent some time setting up a build environment on Windows. Does this
archivework for you?
pg_qualstats-2.0.3-pg12-x64.zip
<https://github.com/powa-team/pg_qualstats/files/6988037/pg_qualstats-2.0.3-pg12-x64.zip>
It should be extracted in the root folder of your postgres 12 installation.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#40 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AICK33F73BY7GLSP4WKTG3TT46SLRANCNFSM47N5QYCA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>
.
|
Great, thanks a lot! I also have an installer if you prefer, but github doesn't let me add it here. I temporarily added it to the 2.0.3 release at https://github.com/powa-team/pg_qualstats/releases/download/2.0.3/pg_qualstats-2.0.3-pg12-x64.exe Let me know one you downloaded it so I can remove it from the release, as I'm not entirely sure that it's working as expected yet. |
I owe you one !
it works perfectly and this is the utility I always dreamt for postgres
Gabriele
Il giorno mar 17 ago 2021 alle ore 15:18 Julien Rouhaud <
***@***.***> ha scritto:
… Great, thanks a lot! I also have an installer if you prefer, but github
doesn't let me add it here. I temporarily added it to the 2.0.3 release at
https://github.com/powa-team/pg_qualstats/releases/download/2.0.3/pg_qualstats-2.0.3-pg12-x64.exe
Let me know one you downloaded it so I can remove it from the release, as
I'm not entirely sure that it's working as expected yet.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#40 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AICK33GI2OB63MGNMAULCMDT5JOSVANCNFSM47N5QYCA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>
.
|
That's an excellent news! Thanks a lot for testing @gdonufrio! I will upload the zip archives and installers for all pg versions then, and will keep doing so for all upcoming releases for all the extensions I maintain! |
@rjuju Where can I find a Windows installer for 2.0.4? |
@cowwoc sorry, I want to automate this but never found the time to work on that. I just attached the zip and installers for the 2.0.4. |
Please , can you make a setup for pg12 on windows systems?
The text was updated successfully, but these errors were encountered: