sraoss / pg_ivm

IVM (Incremental View Maintenance) implementation as a PostgreSQL extension
Other
854 stars 24 forks source link

installations in windows machine #51

Open kanchanbd04 opened 1 year ago

kanchanbd04 commented 1 year ago

I face some problem while installing pg_ivm module in postgres on my windows machine. Can you please kindly help me?

How do I install pg_ivm in postgres on my windows machine?

I use postgresql 14 version. Is pg_ivm module included as built-in feature in any postgresql version?

delemercier commented 1 year ago

Hello,

On my windows machine, I had to use docker in WSL2 to make it run.

Here are my configs :

docker-compose.yml


version: '3.1'

services:
  db:
    image: postgresql-ivm
    restart: always
    build: ./
    environment:
      POSTGRES_PASSWORD: mypassword
      POSTGRES_DB: postres
    ports:
      - 5432:5432

Dockerfile :

FROM postgres:14-alpine3.15

LABEL maintainer="Denis Lemercier"

RUN apk add --no-cache --virtual .fetch-deps \
        ca-certificates \
        openssl \
        unzip \
    \
    && wget -O pv_ivm.zip "https://github.com/sraoss/pg_ivm/archive/refs/heads/main.zip" \
    && mkdir -p /usr/src/pg_ivm \
    && unzip -d /usr/src/pg_ivm/ pv_ivm.zip \
    && apk add --no-cache --virtual .build-deps \
        autoconf \
        automake \
        clang-dev \
        file \
        g++ \
        gcc \
        gettext-dev \
        json-c-dev \
        libtool \
        libxml2-dev \
        llvm-dev \
        make \
        pcre-dev \
        perl \
        protobuf-c-dev \
    \
    && cd /usr/src/pg_ivm/pg_ivm-main \
    && make install \

Then : docker-compose up -d

yugo-n commented 1 year ago

I face some problem while installing pg_ivm module in postgres on my windows machine.

What problems are you facing?

I am not familiar to Windows, but if you are facing errors like unresolved external symbol InvalidObjectAddress, the reason would be that such keywords are not exported. This would be resolved in PG15 in the following commit; https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=8ec569479fc28ddd634a13dc100b36352ec3a3c2

In order to build pg_ivm with PG14, perhaps it might be resolved by making DEF file for exporting them, for example,

LIBRARY pg_ivm
EXPORTS
  InvalidObjectAddress                @1
  ....

See https://learn.microsoft.com/en-us/cpp/build/exporting-from-a-dll-using-def-files?view=msvc-170