Install pgtt on windows server?
rgonzalezVeolia opened this issue · 79 comments
Hello, I have tried to install pgtt extension in postgres 13 on windows server, but I only receive errors when trying to run make... will anyone have any documents to install on windows?
I don't have enough knowledge and especially the desire to spend time on a port for Windows. If anyone can support this porting to Windows OS, a patch would be welcome. Thanks.
I compiled the latest version of pgtt for pg13 windows on windows. Can you try the attached archive? I also have an installer but unfortunately github doesn't allow linking it here.
I compiled the latest version of pgtt for pg13 windows on windows. Can you try the attached archive? I also have an installer but unfortunately github doesn't allow linking it here.
Thanks a lot!!! maybe can you send to me? rodrigo-andres.gonzalez@veolia.com
I tried but my email provider also blocks .exe
attachments. I uploaded it at https://transfert.free.fr/9dePGmw, the link should stay valid for the next 7 days.
I tried but my email provider also blocks
.exe
attachments. I uploaded it at https://transfert.free.fr/9dePGmw, the link should stay valid for the next 7 days.
Thanks!!! Work fine on release 13... one question more, i tried to use in release 12, but this show me an incompatible version error. If possible use in release 12, what i must change?
Thank for the confirmation, that's a very good news!
one question more, i tried to use in release 12, but this show me an incompatible version error. If possible use in release 12, what i must change?
That's expected. While pgtt source code with compatible with pg12 up to the current development version of postgres (pg17), the compiled version is only compatible with a single major version. That's why the installer hints you to install the extension in the postgres 13 directory (at least if it finds the correct registry keys).
I had to patch some stuff to be able to compile it and generate the installer, so I wanted to make sure that it was actually working before spending too much effort with this approach. Now that I know it works I will work with @darold to make a few adjustments, and also fix the windows compile system. Once done I will be able to generate an installer for all supported version and will give them to @darold so he can upload them on the release page.
thanks for your help!!! i'll be waiting!!!
I finally had time to work on this. I just sent a PR to ease the windows installer creation (the script also needed some changes) and using those I could generate installers for all supported postgre smajor versions (12 to 16). I uploaded them at https://transfert.free.fr/D8M2FtD
If you can test the pg12 version that would confirm that it's all good and that we can publish them on the release apge.
Thanks!!!
pgtt installed OK. But, the tables exist while the session exist. This tables must be registered under pgtt_schema?
example of one temp table:
LOAD 'pgtt';
CREATE /GLOBAL/ TEMPORARY TABLE ht_attributetypemodel (
oid varchar(32) NOT NULL
) ON COMMIT DELETE ROWS ;
ALTER TABLE ht_attributetypemodel ALTER COLUMN oid SET NOT NULL;
Under Linux work fine, and the table exist in schema pgtt_schema. In windows this is not working.
I realized that the new version is not the "real" 3.2.0" but the latest commit, which includes some other changes related to the LOAD 'pgtt' thing.
Was the installer for version 13 actually working? If yes I can try to generate the installer for version 12 with the "real" pgtt version 3.2.0 and see if that fixes the problem. In that case we will be able to look at this issue before releasing a new pgtt version.
I realized that the new version is not the "real" 3.2.0" but the latest commit, which includes some other changes related to the LOAD 'pgtt' thing.
Was the installer for version 13 actually working? If yes I can try to generate the installer for version 12 with the "real" pgtt version 3.2.0 and see if that fixes the problem. In that case we will be able to look at this issue before releasing a new pgtt version.
Not really. The installer work, i can create the extension and load, but the temporary tables is not working, i mean, this exist only in the session, then this tables desapear. This tables, must stay in the pgtt_schema, and is not stayed there.
so the same behaviour with both the first installer and the new one?
just to be sure, did you check with CREATE GLOBAL TEMPORARY TABLE rather that with GLOBAL between comments?
so the same behaviour with both the first installer and the new one?
Yes, same behavior.
just to be sure, did you check with CREATE GLOBAL TEMPORARY TABLE rather that with GLOBAL between comments?
Yes, same behavior, and show me a warning of obsolete.
Hi, I need the latest version of the extension for Windows and compatible with PostgreSQL 16, is there any update here?
Hi @dariocorti, have you tested latest development code? If so, do you have the same issue above?
Hi @dariocorti, have you tested latest development code? If so, do you have the same issue above?
Hi @darold, I tried to compile the last version with Microsoft Visual studio to generate del .dll file, but when I execute the LOAD command in Postgres I recevie the errore that it's not compatible with 16 version. Is there a package already compiled as .dll that working in Windows?
How about if you enable the extension by setting session_preload_libraries='pgtt'
?
You can find an installer and a zip file containing all the required files to install the latest commit of pgtt on pg16: https://transfert.free.fr/AOao3oi
As this is the latest commit, it includes the recent changes to allow session_preload_libraries='pgtt'
rather than an explicit LOAD
command.
If you can confirm that this is fully functionnal is would be a very good news as we will be able to provide those for all pgtt versions on all pg versions.
@rgonzalezVeolia I have been unable to reproduce the issue on linux. Just to be sure, did you refresh the pgad;im object tree after execute the CREATE /* GLOBAL */ TEMPORARY TABLE
command?
Or maybe the problem you hit was actually something like what I describe in #48 ? That would explain why it seems to fail but would actually be just a corner case bug.
You can find an installer and a zip file containing all the required files to install the latest commit of pgtt on pg16: https://transfert.free.fr/AOao3oi
As this is the latest commit, it includes the recent changes to allow
session_preload_libraries='pgtt'
rather than an explicitLOAD
command.If you can confirm that this is fully functionnal is would be a very good news as we will be able to provide those for all pgtt versions on all pg versions.
Hi @rjuju, I confirm that works!! Thanks!
@rgonzalezVeolia I have been unable to reproduce the issue on linux. Just to be sure, did you refresh the pgad;im object tree after execute the
CREATE /* GLOBAL */ TEMPORARY TABLE
command?Or maybe the problem you hit was actually something like what I describe in #48 ? That would explain why it seems to fail but would actually be just a corner case bug.
Yes, refresh after execution ...
Thanks for the confirmation. I really don't know what could be the problem in your case.
You can see that i create temporary table. But, is not in the list from pgtt_schema.
Can you do the same but in a psql console, just to remove the doubt on use through pgadmin?
In your second connection you have to execute LOAD 'pgtt';
before doing the SELECT.
You need to do the same LOAD 'pgtt';
in the new connection, and issue another query first to avoid the bug that was fiexed yesterday, so something like
LOAD 'pgtt';
SELECT 1;
SELECT * FROM hr_attributetypemodel;
that's really strange. Can you show the result of SHOW search_path;
? It should at least confirm that the extension seems to be setup as intended.
ah, then it's NOT working at all.
do you have other extension installed? what does SHOW shared_preload_libraries;
output?
How about SHOW pgtt.enabled;
?
ok, so for some reason LOAD 'pgtt';
doesn't seem to have any effect. I really don't know how it could happen as the LOAD should fail if there's no module associated. Can you check that trying to load an unexisting module fails? Like LOAD 'pgtt2';
how can i deinstall pgtt?, to try install again, y then do i will test.
How about the output if you do the following:
SET pggtt.enabled TO on;
LOAD 'pgtt';
SELECT * FROM pgtt_schema.pg_global_temp_tables;
SELECT * FROM hr_attributetypemodel;
you should remove the pgtt.dll that's in one of the sub directories of that installation (in C:\Program Files or similar typically)
it can't works, the table have not been created.
Let's restart from the table creation
SET pggtt.enabled TO on;
LOAD 'pgtt';
CREATE GLOBAL TEMPORARY TABLE hr_attributetypemodel (id int);
SELECT * FROM pgtt_schema.pg_global_temp_tables;
\c - -
SET pggtt.enabled TO on;
LOAD 'pgtt';
SELECT * FROM pgtt_schema.pg_global_temp_tables;
SELECT * FROM hr_attributetypemodel;
can you execute exactly the script I have post please just to be sure that it doesn't work in this simple use. Just copy paste the code in psql.
SET pggtt.enabled TO on; (this line is ok?)
Ya, it don't works at all. Can you set session_preload_libraries='pgtt'
in your postgresql.conf then restart PG.
Once it is done execute again the script.
And if needed here's an installer for the latest commit (f84fa01) for pg13 https://transfert.free.fr/c3PHn7Z
It behave just like if the extension is not loaded. I guess that if you execute the following
SET pggtt.enabled TO on;
LOAD 'pgtt';
SELECT 1;
SHOW search_path;
CREATE GLOBAL TEMPORARY TABLE hr_attributetypemodel (id int);
\d hr_attributetypemodel
it will not change the search_path and create a real temporary table that of course disappears when we reconnect.
if you can remove the extension and use latest installer send by rjuju and give it a try.
I'm dry of solution here, next test could be to use PG16 like @dariocorti and see if you still have the issue.
There is nothing in the log file that could be of any interest to find why the extension not loaded?
if you can remove the extension and use latest installer send by rjuju and give it a try.
did it. Same problem.
Well give a try with PG16 that's all I can say now.
OK, Im installing on my machine, not same server with problem. I'll let you know how it work.
Version 16.
So this is a problem with PG13, thanks for the test.
would you try repair to PG13?
I will let @rjuju answer to this question but why are you using pgtt? If this is for a migration for Oracle I recommend you to use PG16. Why do you need PG13?
PG13 is a requirement from custom. :|
And why using Global Temporary Table? Also note that pgtt works perfectly on PG13 under Linux, does Windows is also a customer requirement?
yes, is requirement also.
I tried locally on a pg16 server I could manage to create, using the last zip file I shared above:
postgres=# select version();
version
------------------------------------------------------------
PostgreSQL 16.1, compiled by Visual C++ build 1937, 64-bit
(1 row)
postgres=# show search_path;
search_path
-----------------
"$user", public
(1 row)
postgres=# load 'pgtt';
LOAD
postgres=# show search_path;
search_path
--------------------
public,pgtt_schema
(1 row)
postgres=# create global temporary table t_tbl(id integer);
WARNING: GLOBAL is deprecated in temporary table creation
LINE 1: create global temporary table t_tbl(id integer);
^
CREATE TABLE
postgres=# \c
You are now connected to database "postgres" as user "postgres".
postgres=# load 'pgtt';
LOAD
postgres=# select * from t_tbl;
id
----
(0 rows)
It works as expected. I really have no explanation why it doesn't work for you.
sorry I missed that you confirmed that it's working for you for pg16.
I try to do the same on a local pg13 and I confirm that I have the same behaviour as you: nothing works. I added an explicit WARNING message at the beginning of the LOAD command and it's also not emitted, so it's clear that pg13 on windows for some reason is broken. since it works just fine on Linux, your best hope is to contact edb packagers and ask them what needs to be done to make it work, as it's the only moving piece here.
I'm closing this issue, port to Windows is considered as done. Thanks again to @rjuju
@rgonzalezVeolia good news, I finally found why the extension wasn't working on versions lower than 16. This is now fixed and I uploaded freshly built installers. You can download them from the version 4 release page at https://github.com/darold/pgtt/releases/tag/v4.0.
A confirmation that this is also working for you would be great.
Excellent news, thanks a lot for checking!
I can now finally close the issue as resolved :)