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

Win10 + pg10 + R3.4.2 + PLR 8.3.0.17 = problem finding plr_call_handler in plr.dll #26

Closed
Goldfish42 opened this issue Oct 11, 2017 · 23 comments

Comments

@Goldfish42
Copy link

Goldfish42 commented Oct 11, 2017

Fresh Win10x64 machine. Installed EnterpriseDB's PostgreSQL 10.0 and R 3.4.2.

Path includes:

C:\Program Files\PostgreSQL\10\bin
C:\Program Files\PostgreSQL\10\lib
C:\Program Files\R\R-3.4.2\bin\x64

R_HOME is:

C:\Program Files\R\R-3.4.2

Using PLR 8.3.0.17 for pg10 and R3.4.2.

plr.dll is in:

C:\Program Files\PostgreSQL\10\lib\

plr.control, plr--8.3.0.17.sql, plr--unpackaged--8.3.0.17.sql are in:

C:\Program Files\PostgreSQL\10\share\extension\

README.plr is in:

C:\Program Files\PostgreSQL\10\doc\extension\

Then I start up the service, connect to a db and try:
CREATE EXTENSION plr SCHEMA plr VERSION "8.3.0.17";
Which yields:

ERROR: could not find function "plr_call_handler" in file "C:/Program Files/PostgreSQL/10/lib/plr.dll"

This is a new message for me. Not finding anything useful on Google. Ideas?

P.S. I can't wait for the day when: pgc install plr-pg10 is a thing for BigSQL! =)

@jconway
Copy link
Collaborator

jconway commented Oct 11, 2017

Per the INSTALL.txt:

"For example, these directories might be:
= C:\PostgreSQL\10.0
= C:\R\R-3.4.2
I recommend you ensure there are no spaces in the pathname to either or .
Correct quoting of pathnames with spaces is left as an exercise for the reader ;-)"

Can you try with Postgres and R installed in those paths, i.e. no spaces? Also, perhaps reboot after changing the environment variables.

I actually saw the same error while getting this plr.dll to work on my Windows VM, but it went away after making those changes. I'm afraid pretty much the only time I use Windows is to compile plr.dll for others to use, so I'm not sure what else could be the issue. Sure would be nice is we could get someone with more Windows development experience to help out here :-/ (I met some Azure PostgreSQL people at a recent conference, so maybe not entirely a lost cause).

Of course, my real advice is the same as always -- switch to Linux then everything "just works" ;-)

@Goldfish42
Copy link
Author

Goldfish42 commented Oct 12, 2017

Thanks, but this didn't work for me. Reinstalled Postgres and R up on the C root, rebooted after changing env variables, but I get the same error message now pointing to "C:/PostgreSQL/10/lib/plr.dll". I'm not sure why the path spacing would matter for you since it's apparent that it's finding the file in the right location. This spacing suggestion has come up for my other PLR issues in the past, but it's never been the cause of my problems.

I wish I could just switch to Linux, but it's just not an option with the other things I need to support on this machine. Once upon a time, I would stubbornly deal with a Windows VM to do those things, but it would slow me down too much now, and I know this can work as I've just gone ahead and installed 8.3.0.17 on pg9.6 successfully using these same instructions. BTW I noticed that 8.3.0.17 for pg10 doesn't have a "plr.sql" file like the pg9.6 distro does. Is this significant?

@Goldfish42
Copy link
Author

Goldfish42 commented Oct 12, 2017

To prove my point, I went ahead and re-installed 9.6 in Program Files and again successfully installed and tested 8.3.0.17. Then I reinstalled R in Program Files and had the same success. I didn't even have to reboot each time-- I just restarted the pg9.6 service after each change. Something else is going on here with pg10's 8.3.0.17. I'm happy to help troubleshoot in any way, but if it involves setting up a build environment, I'd need some guidance to get started.

@jconway
Copy link
Collaborator

jconway commented Oct 12, 2017

Hmm, did I mention how much I hate Windows ;-)

On the plr.sql file, it is really a remnant of the time before Postgres had (and PL/R supported) the CREATE EXTENSION command. So really no longer needed or appropriate.

I wish I has an answer for you -- If I could reproduce the issue, and figure out how to use Visual Studio debugging tools, I could undoubtedly get to the bottom of this. But on my Win10 VM the pg10 plr.dll is working perfectly with EDB's version of Postgres.

@AndreMikulec
Copy link
Collaborator

AndreMikulec commented Oct 13, 2017

Using PLR 8.3.0.17 for pg10 and R3.4.2. ( from the link above )
https://github.com/postgres-plr/plr/releases/download/REL8_3_0_17/plr-8.3.0.17-pg10.0-R3.4.2-win64.zip

64 bit Dependency walker ( http://www.dependencywalker.com/ ) ( depends22_x64 )

shows that plr.dll
does not have the function "plr_call_handler". It is missing.
It still does have the function "pg_finfo_plr_call_handler."

plr.dll 
Pg_magic_func
pg_finfo_install_rcmd
pg_finfo_plr_array
pg_finfo_plr_array_accum
pg_finfo_plr_array_push
pg_finfo_plr_call_handler
pg_finfo_plr_environ
pg_finfo_plr_get_raw
pg_finfo_plr_set_display
pg_finfo_plr_set_rhome
pg_finfo_plr_unset_rhome
pg_finfo_plr_version
pg_finfo_reload_plr_modules

In contrast, pltcl.dll has both "pltcl_call_handler" and "pg_finfo_pltcl_call_handler"

pltcl.dll
Pg_magic_func
_PG_init
pg_finfo_pltcl_call_handler
pg_finfo_pltclu_call_handler
pltcl_call_handler
pltclu_call_handler

@jconway
Copy link
Collaborator

jconway commented Oct 13, 2017

That's really odd because I used the dependency walker myself after compiling this dll and the functions are all there. Maybe I made some mistake when packing up the dll -- will check

@jconway
Copy link
Collaborator

jconway commented Oct 13, 2017

Ok, near as I can tell I screwed up :-(

The file in the uploaded zip was an earlier DLL that came from a failed build. Apparently after I corrected the build and tested the new DLL successfully, I somehow forgot to copy the newer good one over the older bad one prior to uploading the zip.

Anyway, I think I got it right this time -- new plr-8.3.0.17-pg10.0-R3.4.2-win64.zip hopefully fixes the issue for pg10/R3.4.2/plr using the EDB build of pg10.

@AndreMikulec
Copy link
Collaborator

AndreMikulec commented Oct 14, 2017

Thank you,

Using Dependency Walker, later, I also compared the function list the PostgreSQL 10 plr.dll that I built using the vanilla build of PostgreSQL 10 using MSYS2 and MINGW64.

Something, strange (in a good way), the case seems, that I can also use that PostgreSQL 10 build of plr.dll using MSYS2 and MINGW64 to be the 'plr' in EnterpriseDB PostgreSQL 10 on Windows x86-64.

I just have to copy "plr.dll" to be called the file "plr" (with no filename extension). ( Am I crazy? I do not think this method worked in 9.6.)

postgres=# select version();
                          version
------------------------------------------------------------
 PostgreSQL 10.0, compiled by Visual C++ build 1800, 64-bit
(1 row)

postgres=# create extension plr;
CREATE EXTENSION
postgres=# select plr_version();
 plr_version
-------------
 08.03.00.17
(1 row)

postgres=# select r_version();
ERROR:  could not access file "C:/Program Files/PostgreSQL/10/lib/plr": No such file or directory
postgres=#

Copy plr.dll to plr
I did not: "shutdown and restart"

postgres=# select r_version();
                    r_version
-------------------------------------------------
 (platform,x86_64-w64-mingw32)
 (arch,x86_64)
 (os,mingw32)
 (system,"x86_64, mingw32")
 (status,"")
 (major,3)
 (minor,4.2)
 (year,2017)
 (month,09)
 (day,28)
 ("svn rev",73368)
 (language,R)
 (version.string,"R version 3.4.2 (2017-09-28)")
 (nickname,"Short Summer")
(14 rows)

sgennaria,

If you are still there on the line' and want to try..

This evening, this worked for me.

SYSTEM variables (I only tested with "SYSTEM" variables)

PATH=C:\Path\to\PostgreSQL\directory\bin;C:\Path\to\PostgreSQL\directory\lib;C:\Path\to\R\bin\x64;. . . rest of path . . .
R_HOME=C:\Path\to\R

EnterpriseDB PostgreSQL 10 on Windows x86-64

https://www.enterprisedb.com/downloads/postgres-postgresql-downloads#windows

Service name and "Log On As"

postgresql-x64-10
Log on as "Network Service" (This is the default.  Leave it.)

Note: Rules are here ...
NetworkService Account
https://msdn.microsoft.com/en-us/library/windows/desktop/ms684272(v=vs.85).aspx

Needed are both plr.dll (CREATE EXTENSION PLR;) and plr (to run a plr function).

Attached is plr(plr.dll/plr) as plr.gif.
The .gif extension is so github can accept it as an attachment.
Github renames the file. I verified with KDiff3 that the downloaded file is the same as the uploaded file.

To use it, just rename the .gif file twice to both plr.dll and plr

plr.gif

@AndreMikulec
Copy link
Collaborator

Maybe this is why my MSYS2 MINGW64 plr.dll works in EnterpriseDB PostgreSQL 10 on Windows x86-64?

Automatically mark all PG_FUNCTION_INFO_V1 functions as DLLEXPORT-ed on Windows (Laurenz Albe)
https://www.postgresql.org/docs/10/static/release-10.html

@Goldfish42
Copy link
Author

@AndreMikulec Thanks! I managed to get this working for both EnterpriseDB and BigSQL using the PLR download from Joe's website. Instructions to follow....

@Goldfish42
Copy link
Author

Goldfish42 commented Oct 14, 2017

Install instructions for PLR 8.3.0.17 with R 3.4.2 and EnterpriseDB PostgreSQL 10.0 on Windows 10 64-bit

  1. Download and install R 3.4.2 to default directory (C:\Program Files\R\R-3.4.2) from https://cran.r-project.org/bin/windows/base/

  2. Open an ADMINISTRATIVE Command Prompt (CMD1) to prepare your environment variables:

Microsoft Windows [Version 10.0.15063]
(c) 2017 Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32>setx /M PATH "%PATH%;C:\Program Files\PostgreSQL\10\bin;C:\Program Files\PostgreSQL\10\lib;C:\Program Files\R\R-3.4.2\bin\x64;"

SUCCESS: Specified value was saved.

C:\WINDOWS\system32>setx /M R_HOME "C:\Program Files\R\R-3.4.2"

SUCCESS: Specified value was saved.
  1. Close CMD1. Then download and install PostgreSQL 10.0 to default directory (C:\Program Files\PostgreSQL\10) from https://get.enterprisedb.com/postgresql/postgresql-10.0-1-windows-x64.exe

  2. Download and unzip plr-8.3.0.17-pg10.0-R3.4.2-win64.zip from https://www.joeconway.com/doc/downloads/plr-8.3.0.17-pg10.0-R3.4.2-win64.zip

  3. From the unzipped contents, move the following files to their destinations:

plr.control -------------------> C:\Program Files\PostgreSQL\10\share\extension
plr--8.3.0.17.sql -------------> C:\Program Files\PostgreSQL\10\share\extension
plr--unpackaged--8.3.0.17.sql -> C:\Program Files\PostgreSQL\10\share\extension
README.plr --------------------> C:\Program Files\PostgreSQL\10\doc\extension
plr.dll -----------------------> C:\Program Files\PostgreSQL\10\lib
  1. Open a new ADMINISTRATIVE Command Prompt (CMD2) to restart the Postgres service so it can detect the new PLR files and environment variables.
Microsoft Windows [Version 10.0.15063]
(c) 2017 Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32>net stop postgresql-x64-10
The postgresql-x64-10 service is stopping.
The postgresql-x64-10 service was stopped successfully.


C:\WINDOWS\system32>net start postgresql-x64-10
The postgresql-x64-10 service is starting.
The postgresql-x64-10 service was started successfully.


C:\WINDOWS\system32>psql postgres postgres
psql (10.0)
WARNING: Console code page (437) differs from Windows code page (1252)
         8-bit characters might not work correctly. See psql reference
         page "Notes for Windows users" for details.
Type "help" for help.

postgres=# CREATE EXTENSION plr;
CREATE EXTENSION
postgres=# SELECT * FROM version();
                          version
------------------------------------------------------------
 PostgreSQL 10.0, compiled by Visual C++ build 1800, 64-bit
(1 row)


postgres=# SELECT * FROM r_version();
      name      |            value
----------------+------------------------------
 platform       | x86_64-w64-mingw32
 arch           | x86_64
 os             | mingw32
 system         | x86_64, mingw32
 status         |
 major          | 3
 minor          | 4.2
 year           | 2017
 month          | 09
 day            | 28
 svn rev        | 73368
 language       | R
 version.string | R version 3.4.2 (2017-09-28)
 nickname       | Short Summer
(14 rows)


postgres=#

@Goldfish42
Copy link
Author

Goldfish42 commented Oct 14, 2017

Install instructions for PLR 8.3.0.17 with R 3.4.2 and BigSQL PostgreSQL 10.0 on Windows 10 64-bit

  1. Download and install R 3.4.2 to default directory (C:\Program Files\R\R-3.4.2) from https://cran.r-project.org/bin/windows/base/

  2. Open an ADMINISTRATIVE Command Prompt (CMD1) to prepare your environment variables, install PGC and install pg10:

Microsoft Windows [Version 10.0.15063]
(c) 2017 Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32>setx /M PATH "%PATH%;C:\PostgreSQL\bigsql\;C:\PostgreSQL\bigsql\pg10\bin;C:\PostgreSQL\bigsql\pg10\lib\postgresql;C:\Program Files\R\R-3.4.2\bin\x64;"

SUCCESS: Specified value was saved.

C:\WINDOWS\system32>setx /M R_HOME "C:\Program Files\R\R-3.4.2"

SUCCESS: Specified value was saved.

C:\WINDOWS\system32>cd \

C:\>mkdir PostgreSQL

C:\>cd PostgreSQL

C:\PostgreSQL>@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://s3.amazonaws.com/pgcentral/install.ps1'))"

Downloading BigSQL PGC 3.3.0 ...

Unpacking ...

Setting REPO to https://s3.amazonaws.com/pgcentral

Updating Metadata


BigSQL PGC installed.
  Try 'bigsql\pgc help' to get started.


C:\PostgreSQL>cd bigsql

C:\PostgreSQL\bigsql>pgc install pg10
  ['pg10']
Get:1 https://s3.amazonaws.com/pgcentral pg10-10.0-1-win64
 Unpacking pg10-10.0-1-win64.tar.bz2
C:\PostgreSQL\bigsql>pgc init pg10

## Initializing pg10 #######################

Superuser Password [password]:
Confirm Password:
Setting directory and file permissions.
processed file: C:\POSTGR~1\bigsql\data\pg10
Successfully processed 1 files; Failed processing 0 files
setting permission to log dir
processed file: C:\POSTGR~1\bigsql\data\logs\pg10
Successfully processed 1 files; Failed processing 0 files

Initializing Postgres DB at:
   -D "C:\POSTGR~1\bigsql\data\pg10"

Using PostgreSQL Port 5432

Password securely remembered in the file: C:\Users\myuser\AppData\Roaming\postgresql\pgpass.conf

to load this postgres into your environment, run the env file:
    C:\POSTGR~1\bigsql\pg10\pg10-env.bat

C:\PostgreSQL\bigsql>
  1. Close CMD1.

  2. Download and unzip plr-8.3.0.17-pg10.0-R3.4.2-win64.zip from https://www.joeconway.com/doc/downloads/plr-8.3.0.17-pg10.0-R3.4.2-win64.zip

  3. From the unzipped contents, move the following files to their destinations:

plr.control -------------------> C:\PostgreSQL\bigsql\pg96\share\postgresql\extension
plr--8.3.0.17.sql -------------> C:\PostgreSQL\bigsql\pg96\share\postgresql\extension
plr--unpackaged--8.3.0.17.sql -> C:\PostgreSQL\bigsql\pg96\share\postgresql\extension
README.plr --------------------> C:\PostgreSQL\bigsql\pg96\share\doc\postgresql\extension
plr.dll -----------------------> C:\PostgreSQL\bigsql\pg10\lib\postgresql
  1. Inside the C:\PostgreSQL\bigsql\pg10\lib\postgresql directory, copy-and-paste plr.dll to the same location, then name the new copy just plr without any extension.

  2. Open a new NON-ADMINISTRATIVE Command Prompt (CMD2) to configure autostart:

Microsoft Windows [Version 10.0.15063]
(c) 2017 Microsoft Corporation. All rights reserved.

C:\Users\myuser>pgc config pg10 --autostart=on
Giving current user permission to log dir
processed file: C:\POSTGR~1\bigsql\data\logs\pg10
Successfully processed 1 files; Failed processing 0 files
Creating PostgreSQL pg10 service
C:\Users\myuser>

  1. Open a new ADMINISTRATIVE Command Prompt (CMD3), start the pg96 service and try to install PLR:
Microsoft Windows [Version 10.0.15063]
(c) 2017 Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32>pgc start pg10
pg10 starting on port 5432
 sc start "PostgreSQL 1.0 Server"
C:\Windows\System32>psql postgres postgres
psql (10.0)
WARNING: Console code page (437) differs from Windows code page (1252)
         8-bit characters might not work correctly. See psql reference
         page "Notes for Windows users" for details.
Type "help" for help.

postgres=# CREATE EXTENSION plr;
CREATE EXTENSION
postgres=# SELECT * FROM version();
                                                version
--------------------------------------------------------------------------------------------------------
 PostgreSQL 10.0 on x86_64-pc-mingw64, compiled by gcc.exe (Rev5, Built by MSYS2 project) 4.9.2, 64-bit
(1 row)


postgres=# SELECT * FROM r_version();
      name      |            value
----------------+------------------------------
 platform       | x86_64-w64-mingw32
 arch           | x86_64
 os             | mingw32
 system         | x86_64, mingw32
 status         |
 major          | 3
 minor          | 4.2
 year           | 2017
 month          | 09
 day            | 28
 svn rev        | 73368
 language       | R
 version.string | R version 3.4.2 (2017-09-28)
 nickname       | Short Summer
(14 rows)


postgres=#

Unfortunately, you can't use this method to configure a second BigSQL Postgres version with autostart=on. So alternatively, you can skip step 7 and just manually start your other versions with autostart=off and your environment variables configured appropriately.

@jconway
Copy link
Collaborator

jconway commented Oct 14, 2017

That's awesome -- thanks for working it out and documenting it.

@AndreMikulec
Copy link
Collaborator

AndreMikulec commented Oct 14, 2017

sgennaria,
Same! awesome!

I did notice in your docs, the use of 'setx /M' system wide (HKEY_LOCAL_MACHINE) variables.
I did notice the installation of the 'windows service' defaults . . .

EnterpriseDB service "postgresql-x64-..."    Log on as "Network Service"

BigSQL       service "PostgreSQL ... Server" Log on as "Local System Account"

Rules are here ...

LocalSystem Account
https://msdn.microsoft.com/en-us/library/windows/desktop/ms684190(v=vs.85).aspx

NetworkService Account
https://msdn.microsoft.com/en-us/library/windows/desktop/ms684272(v=vs.85).aspx

I am glad that works!

On a side note, some people prefer to add new PATH directories to the beginning (left side) of the PATH. The PATH is read left to right. Sometimes people get 'tripped up' on this feature, because an unexpected(wrong) exe is read. Each method ( beginning/end of ) PATH, has its own advantages and disadvantages. Here, for example, is 'beginning of' PATH

setx /M PATH C:\Path\To\X;"%PATH%

Also, that annoying 'Microsoft Windows' message

WARNING: Console code page (437) differs from Windows code page (1252)
         8-bit characters might not work correctly. See psql reference
         page "Notes for Windows users" for details.

may be removed.

This person here ...
PostgreSQL Portable ( EnterpriseDB PostgreSQL 32bit)
https://sourceforge.net/projects/postgresqlportable/

has this nice method to specify a code page number.

chcp 1252 > nul && psql -U postgres

In EnterpriseDB ...

C:\PG-10edb._>psql -U postgres
psql (10.0)
WARNING: Console code page (437) differs from Windows code page (1252)
         8-bit characters might not work correctly. See psql reference
         page "Notes for Windows users" for details.
Type "help" for help.

postgres=# \q

C:\PG-10edb._>chcp 1252 > nul && psql -U postgres
psql (10.0)
Type "help" for help.

postgres=# \q

C:\PG-10edb._>

In BigSQL ...

C:\PG-10big._\pg10>psql -U postgres
psql (10.0)
WARNING: Console code page (437) differs from Windows code page (1252)
         8-bit characters might not work correctly. See psql reference
         page "Notes for Windows users" for details.
Type "help" for help.

postgres=# \q

C:\PG-10big._\pg10>chcp 1252 > nul && psql -U postgres
psql (10.0)
Type "help" for help.

postgres=# \q

C:\PG-10big._\pg10>

@Goldfish42
Copy link
Author

@AndreMikulec I confirmed that your plr.dll disguised as plr.gif works perfectly for my BigSQL pg10 install without the need for any workarounds.

Regarding your other comments, I'm not sure I completely follow, but is the Local System Account a less-secure way of running services in Windows?

As for the PATH bit, I was just looking for a succinct way to get the point across. I usually use Win+R: sysdm.cpl to edit my own env variables. I figured anyone with the wherewithal would mod the PATH as they see fit. Caveat emptor, in a way =)

And that's a cool trick you found to specify the console code page. I do everything in pgAdmin3, so I'm not used to such nuances.

@davecramer
Copy link
Collaborator

OK, guys I was able to build plr using appveyor, can you guys test this https://github.com/davecramer/plr/releases/tag/testdeploy1

@AndreMikulec
Copy link
Collaborator

From
https://github.com/davecramer/plr/releases/tag/testdeploy1
I get back a broken link ...

404 This is not the page you are looking for.

@davecramer
Copy link
Collaborator

davecramer commented Nov 12, 2017 via email

@AndreMikulec
Copy link
Collaborator

Dave,
Yes that works (EnterpriseDB and BigSQL).
You are the Man!

A trick on BigSQL (shown far below) is
to make a 2nd file called "plr" ( plr.dll without the file extension. )
(I had to do that again.)

EnterpriseDB

Server [localhost]:
Database [postgres]:
Port [5432]:
Username [postgres]:
psql (10.0)
WARNING: Console code page (437) differs from Windows code page (1252)
         8-bit characters might not work correctly. See psql reference
         page "Notes for Windows users" for details.
Type "help" for help.

postgres=# create extension plr;
ERROR:  extension "plr" already exists
postgres=# select version();
                          version
------------------------------------------------------------
 PostgreSQL 10.0, compiled by Visual C++ build 1800, 64-bit
(1 row)


postgres=# select plr_version();
 plr_version
-------------
 08.03.00.17
(1 row)


postgres=# select r_version();
                    r_version
-------------------------------------------------
 (platform,x86_64-w64-mingw32)
 (arch,x86_64)
 (os,mingw32)
 (system,"x86_64, mingw32")
 (status,"")
 (major,3)
 (minor,4.2)
 (year,2017)
 (month,09)
 (day,28)
 ("svn rev",73368)
 (language,R)
 (version.string,"R version 3.4.2 (2017-09-28)")
 (nickname,"Short Summer")
(14 rows)

postgres=# drop extension plr;
DROP EXTENSION

Manually rename(hide) plr and plr.dll to plr_ANDRE and plr.dll_ANDRE

postgres=# create extension plr;
ERROR:  could not access file "$libdir/plr": No such file or directory

Copy in plr_DaveCramer_Nov_11_2017.dll
Copy plr_DaveCramer_Nov_11_2017.dll to plr.dll

postgres=# create extension plr;
CREATE EXTENSION
postgres=# select plr_version();
 plr_version
-------------
 08.03.00.17
(1 row)


postgres=# select r_version();
                    r_version
-------------------------------------------------
 (platform,x86_64-w64-mingw32)
 (arch,x86_64)
 (os,mingw32)
 (system,"x86_64, mingw32")
 (status,"")
 (major,3)
 (minor,4.2)
 (year,2017)
 (month,09)
 (day,28)
 ("svn rev",73368)
 (language,R)
 (version.string,"R version 3.4.2 (2017-09-28)")
 (nickname,"Short Summer")
(14 rows)


postgres=#

BigSQL

Waiting for 0 seconds, press a key to continue ...
psql (10.0)
Type "help" for help.

postgres=# select version();
                                                version
--------------------------------------------------------------------------------------------------------
 PostgreSQL 10.0 on x86_64-pc-mingw64, compiled by gcc.exe (Rev5, Built by MSYS2 project) 4.9.2, 64-bit
(1 row)


postgres=# drop extension plr;
DROP EXTENSION

Manually rename(hide) plr and plr.dll to plr_ANDRE and plr.dll_ANDRE

postgres=# create extension plr;
ERROR:  could not access file "$libdir/plr": No such file or directory

Copy in plr_DaveCramer_Nov_11_2017.dll
Copy plr_DaveCramer_Nov_11_2017.dll to plr.dll

postgres=# create extension plr;
CREATE EXTENSION
postgres=# select plr_version();
 plr_version
-------------
 08.03.00.17
(1 row)

postgres=# select r_version();
ERROR:  could not access file "C:/PG-10big._/pg10/lib/postgresql/plr": No such file or directory

Copy plr_DaveCramer_Nov_11_2017.dll to plr
(So now both files exist plr.dll and plr)

postgres=# select r_version();
                    r_version
-------------------------------------------------
 (platform,x86_64-w64-mingw32)
 (arch,x86_64)
 (os,mingw32)
 (system,"x86_64, mingw32")
 (status,"")
 (major,3)
 (minor,4.2)
 (year,2017)
 (month,09)
 (day,28)
 ("svn rev",73368)
 (language,R)
 (version.string,"R version 3.4.2 (2017-09-28)")
 (nickname,"Short Summer")
(14 rows)

postgres=#

@davecramer
Copy link
Collaborator

davecramer commented Nov 13, 2017 via email

@AndreMikulec
Copy link
Collaborator

I know some about embedding or renaming.
I know that the versioning rules of the PostgreSQL extensions is in the docs.
I do know very little about Appveyor and its shell scripts.

Perhaps, plr ( for Windows ) need only to be released 2x per year.

..1 once, when the Postgresql version changes: e.g. 9.5._->9.6._, 10._->11._.
..2 once, when the R version changes: e.g.  3.3._ -> 3.4._,  3.4._ -> 3.5._'

The way I understand the situation is that
R versions 3,4.1, 3,4.2, and ('end of November 2017' ) 3.4.3 have just bug-fixes (and have 'very minor other changes'). Similarity, PostgreSQL versions made during the year have bug-fixes ( and have 'very minor other changes) . Once per year, a release happens. (Nothing is guaranteed: I could be wrong. But I think that I am closer to 'right' than 'wrong.')

@davecramer
Copy link
Collaborator

Appveyor is just running simple batch files or power shell commands, No magic there

as for release there would be 1 more case. Where we actually change something in plr. But in general you are correct there are not that many times we need to release on windows.

What I am thinking is a unix script which manipulates the naming of the sql files, and modifies any internal data in those files to align with the new tag and then pushes the tag to github.

@sdebionne
Copy link

sdebionne commented Nov 16, 2017

Copy plr.dll to plr

I had to do that as well to get my PL/R install up and running with PostgreSQL 9.5 / R 3.4.2.

Do you guys know why ? I checked the control file, but would not find anything problematic there.

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

5 participants