-1

I'm trying to make apache age windows installer in order to run age in windows without using WSL2. To compile the source code on windows machine I'm using msys2 as it can be use to build native windows software. The make install command is successful :

# make install
/usr/bin/mkdir -p 'C:/PROGRA~1/POSTGR~1/12/lib'
/usr/bin/mkdir -p 'C:/PROGRA~1/POSTGR~1/12/share/extension'
/usr/bin/mkdir -p 'C:/PROGRA~1/POSTGR~1/12/share/extension'
/usr/bin/install -c -m 755  age.so 'C:/PROGRA~1/POSTGR~1/12/lib/age.so'
/usr/bin/install -c -m 644 .//age.control 'C:/PROGRA~1/POSTGR~1/12/share/extension/'
/usr/bin/install -c -m 644 .//age--1.1.1.sql  'C:/PROGRA~1/POSTGR~1/12/share/extension/'

and age file is present there

# ls "C:\Program Files\PostgreSQL\12\lib" |grep age
age.so
pageinspect.dll

But I'm getting Could not access file "$libdir/age": No such file or directory in psql shell.

Sarthak
  • 380
  • 7

2 Answers2

0

If you have installed the postgresql without problems, try to export the PATH variables:

export PG_CONFIG=/usr/local/pgsql-12/bin/pg_config

You can also search for environment variables using the search bar in Windows. And you can add the correct PATH.

0

The make install command is creating age.so (shared object library) file which is a which is a dynamic library for android/linux.

For windows you need .dll (Dynamic-link library) file for the extension (in addition to age.control and age-version.sql files). I found this article which tells how to build a postgres extension on Winodws.

Basically, you need to:

  • Compile and build the age.c file in visual studio to make age.dll file.
  • Make sure the age.dll is placed at C:\Program Files\PostgreSQL\12\lib.
  • Then run CREATE EXTENSION age; in psql shell.

You can have a look at dlltools as well.

Ahmar
  • 584
  • 2
  • 7