Thread: Cstore_fdw issue.

Cstore_fdw issue.

From
Moses Mafusire
Date:
Hi,
I am new to PostgreSQL, successfully installed PGSql v12.2 on my CentOS 7 machine and I am trying to install cstore_fdw.

    1. I have managed to run this command;
        sudo yum install protobuf-c-devel

    2. Per the instructions I am followin;
        Once you have protobuf-c installed on your machine, you are ready to build cstore_fdw. For this, you need to include the pg_config directory path in your make command. 

    3. I have searched for pg_config directory and found 2 locations;
        /usr/bin/pg_config
        /usr/pgsql-12/bin/pg_config
    
    4. However when I try to run makefile in c_store_fdw I get this error;
        [postgres@dart-centos cstore_fdw]$ sudo PATH=/usr/bin/:$PATH make
        [sudo] password for postgres: 
        Makefile:50: *** PostgreSQL 9.3 to 12 is required to compile this extension.  Stop.

        I even tried the other path, same error;
        [postgres@dart-centos cstore_fdw]$ PATH=/usr/pgsql-12/bin/:$PATH make
        Makefile:50: *** PostgreSQL 9.3 to 12 is required to compile this extension.  Stop.


    5. PostgreSQL Version
        postgres=# show server_version;
        server_version 
        ----------------
     12.2
     (1 row)

    postgres=# \! psql -V
    psql (PostgreSQL) 12.2

May you please assist me with this issue.  

Thank You,
Moses

Re: Cstore_fdw issue.

From
Adrian Klaver
Date:
On 4/2/20 1:40 PM, Moses Mafusire wrote:
> Hi,
> I am new to PostgreSQL, successfully installed PGSql v12.2 on my CentOS 
> 7 machine and I am trying to install cstore_fdw.
> 
>      1. I have managed to run this command;
> /sudo yum install protobuf-c-devel/
> /
> /
> /    2. /Per the instructions I am followin;
> /        Once you have protobuf-c installed on your machine, you are 
> ready to build cstore_fdw. For this, you need to include the pg_config 
> directory path in your make command. /
> /
> /
> // 3. I have searched for pg_config directory and found 2 locations;
>          /usr/bin/pg_config
>          /usr/pgsql-12/bin/pg_config
> //4. However when I try to run makefile in c_store_fdw I get this error;
>          [postgres@dart-centos cstore_fdw]$ sudo PATH=/usr/bin/:$PATH make
> /        [sudo] password for postgres: /
>          Makefile:50: *** PostgreSQL 9.3 to 12 is required to compile 
> this extension.  Stop.
> 
> // I even tried the other path, same error;
>          [postgres@dart-centos cstore_fdw]$ 
> PATH=/usr/pgsql-12/bin/:$PATH make
>          Makefile:50: *** PostgreSQL 9.3 to 12 is required to compile 
> this extension.  Stop.
> 
> 
>      5. PostgreSQL Version
> /        postgres=# show server_version;/
>          server_version
>          ----------------
>       12.2
>       (1 row)
> 
>      postgres=# \! psql -V
>      psql (PostgreSQL) 12.2
> 
> May you please assist me with this issue. //

What do you get if you run:

pg_config

from the command line.

An example from my machine:

aklaver@maura:~> pg_config
BINDIR = /usr/local/pgsql12/bin
DOCDIR = /usr/local/pgsql12/share/doc
HTMLDIR = /usr/local/pgsql12/share/doc
INCLUDEDIR = /usr/local/pgsql12/include
PKGINCLUDEDIR = /usr/local/pgsql12/include
INCLUDEDIR-SERVER = /usr/local/pgsql12/include/server
LIBDIR = /usr/local/pgsql12/lib64
PKGLIBDIR = /usr/local/pgsql12/lib64
LOCALEDIR = /usr/local/pgsql12/share/locale
MANDIR = /usr/local/pgsql12/share/man
SHAREDIR = /usr/local/pgsql12/share
SYSCONFDIR = /usr/local/pgsql12/etc
PGXS = /usr/local/pgsql12/lib64/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--with-python' '--with-openssl' '--with-libxml' 
'--with-uuid=ossp' '--prefix=/usr/local/pgsql12'
CC = gcc
CPPFLAGS = -D_GNU_SOURCE -I/usr/include/libxml2
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith 
-Wdeclaration-after-statement -Werror=vla -Wendif-labels 
-Wmissing-format-attribute -Wformat-security -fno-strict-aliasing 
-fwrapv -fexcess-precision=standard -Wno-format-truncation -O2
CFLAGS_SL = -fPIC
LDFLAGS = -Wl,--as-needed 
-Wl,-rpath,'/usr/local/pgsql12/lib64',--enable-new-dtags
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgcommon -lpgport -lpthread -lxml2 -lssl -lcrypto -lz 
-lreadline -lrt -lcrypt -ldl -lm
VERSION = PostgreSQL 12.1

> 
> Thank You,
> Moses


-- 
Adrian Klaver
adrian.klaver@aklaver.com



Re: Cstore_fdw issue.

From
Moses Mafusire
Date:
Hi Adrian, 
Thanks for your response. Here is what I'm getting when I run pg_config;

$ pg_config
BINDIR = /usr/bin
DOCDIR = /usr/share/doc/pgsql
HTMLDIR = /usr/share/doc/pgsql
INCLUDEDIR = /usr/include
PKGINCLUDEDIR = /usr/include/pgsql
INCLUDEDIR-SERVER = /usr/include/pgsql/server
LIBDIR = /usr/lib64
PKGLIBDIR = /usr/lib64/pgsql
LOCALEDIR = /usr/share/locale
MANDIR = /usr/share/man
SHAREDIR = /usr/share/pgsql
SYSCONFDIR = /etc
PGXS = /usr/lib64/pgsql/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--program-prefix=' '--disable-dependency-tracking' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--disable-rpath' '--with-ldap' '--with-openssl' '--with-gssapi' '--enable-nls' '--without-readline' '--datadir=/usr/share/pgsql' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'CFLAGS=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' 'LDFLAGS=-Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld' 'CXXFLAGS=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' 'PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'
CC = gcc
CPPFLAGS = -D_GNU_SOURCE
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
CFLAGS_SL = -fPIC
LDFLAGS = -Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--as-needed
LDFLAGS_EX = 
LDFLAGS_SL = 
LIBS = -lpgcommon -lpgport -lpthread -lssl -lcrypto -lgssapi_krb5 -lz -lrt -lcrypt -ldl -lm 
VERSION = PostgreSQL 12.1





Moses Mafusire
MCITP DBA, MCTS SQL Developer, MCTS Windows 7 Fundamentals, Certified Internet CIW Foundations Associate, Project+, A+, Security+, Linux+, ITIL


On Thursday, April 2, 2020, 06:27:31 PM EDT, Adrian Klaver <adrian.klaver@aklaver.com> wrote:


On 4/2/20 1:40 PM, Moses Mafusire wrote:
> Hi,
> I am new to PostgreSQL, successfully installed PGSql v12.2 on my CentOS
> 7 machine and I am trying to install cstore_fdw.
>
>      1. I have managed to run this command;
> /sudo yum install protobuf-c-devel/
> /
> /
> /    2. /Per the instructions I am followin;
> /        Once you have protobuf-c installed on your machine, you are
> ready to build cstore_fdw. For this, you need to include the pg_config
> directory path in your make command. /
> /
> /
> // 3. I have searched for pg_config directory and found 2 locations;
>          /usr/bin/pg_config
>          /usr/pgsql-12/bin/pg_config
> //4. However when I try to run makefile in c_store_fdw I get this error;
>          [postgres@dart-centos cstore_fdw]$ sudo PATH=/usr/bin/:$PATH make
> /        [sudo] password for postgres: /
>          Makefile:50: *** PostgreSQL 9.3 to 12 is required to compile
> this extension.  Stop.
>
> // I even tried the other path, same error;
>          [postgres@dart-centos cstore_fdw]$
> PATH=/usr/pgsql-12/bin/:$PATH make
>          Makefile:50: *** PostgreSQL 9.3 to 12 is required to compile
> this extension.  Stop.
>
>
>      5. PostgreSQL Version
> /        postgres=# show server_version;/
>          server_version
>          ----------------
>       12.2
>       (1 row)
>
>      postgres=# \! psql -V
>      psql (PostgreSQL) 12.2
>
> May you please assist me with this issue. //

What do you get if you run:

pg_config

from the command line.

An example from my machine:

aklaver@maura:~> pg_config
BINDIR = /usr/local/pgsql12/bin
DOCDIR = /usr/local/pgsql12/share/doc
HTMLDIR = /usr/local/pgsql12/share/doc
INCLUDEDIR = /usr/local/pgsql12/include
PKGINCLUDEDIR = /usr/local/pgsql12/include
INCLUDEDIR-SERVER = /usr/local/pgsql12/include/server
LIBDIR = /usr/local/pgsql12/lib64
PKGLIBDIR = /usr/local/pgsql12/lib64
LOCALEDIR = /usr/local/pgsql12/share/locale
MANDIR = /usr/local/pgsql12/share/man
SHAREDIR = /usr/local/pgsql12/share
SYSCONFDIR = /usr/local/pgsql12/etc
PGXS = /usr/local/pgsql12/lib64/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--with-python' '--with-openssl' '--with-libxml'
'--with-uuid=ossp' '--prefix=/usr/local/pgsql12'
CC = gcc
CPPFLAGS = -D_GNU_SOURCE -I/usr/include/libxml2
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Werror=vla -Wendif-labels
-Wmissing-format-attribute -Wformat-security -fno-strict-aliasing
-fwrapv -fexcess-precision=standard -Wno-format-truncation -O2
CFLAGS_SL = -fPIC
LDFLAGS = -Wl,--as-needed
-Wl,-rpath,'/usr/local/pgsql12/lib64',--enable-new-dtags
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgcommon -lpgport -lpthread -lxml2 -lssl -lcrypto -lz
-lreadline -lrt -lcrypt -ldl -lm
VERSION = PostgreSQL 12.1


>
> Thank You,
> Moses



--
Adrian Klaver
adrian.klaver@aklaver.com

Re: Cstore_fdw issue.

From
Adrian Klaver
Date:
On 4/3/20 5:53 AM, Moses Mafusire wrote:
> Hi Adrian,
> Thanks for your response. Here is what I'm getting when I run /pg_config;/

> VERSION = PostgreSQL 12.1

So that is the correct version.

Just to be clear there is only one version of Postgres on this machine, 
correct?

Before you run make again, edit the Makefile so:

ifndef MAJORVERSION
     MAJORVERSION := $(basename $(VERSION))
endif

becomes:

ifndef MAJORVERSION
     MAJORVERSION := $(basename $(VERSION))
endif
$(info  MAJORVERSION is $(MAJORVERSION))


When I run the above I get:

aklaver@maura:~/test/cstore_fdw-1.7.0> PATH=/usr/local/pgsql/bin/:$PATH 
make
MAJORVERSION is 12

...

and the code compiles.


> *Moses Mafusire*



-- 
Adrian Klaver
adrian.klaver@aklaver.com



Re: Cstore_fdw issue.

From
Moses Mafusire
Date:
Hi Adrian,
Yes VERSION = PostgreSQL 12.1, is the only version I have. So I am novice to Linux and Postgres, where should I run this 
ifndef MAJORVERSION
    MAJORVERSION := $(basename $(VERSION))
endif
$(info  MAJORVERSION is $(MAJORVERSION))

and do I run as is or do I need to do something else, if so may you please assist. 

Thanks
Moses 

On Friday, April 3, 2020, 11:39:57 AM EDT, Adrian Klaver <adrian.klaver@aklaver.com> wrote:


On 4/3/20 5:53 AM, Moses Mafusire wrote:
> Hi Adrian,
> Thanks for your response. Here is what I'm getting when I run /pg_config;/

> VERSION = PostgreSQL 12.1

So that is the correct version.

Just to be clear there is only one version of Postgres on this machine,
correct?

Before you run make again, edit the Makefile so:

ifndef MAJORVERSION
    MAJORVERSION := $(basename $(VERSION))
endif

becomes:

ifndef MAJORVERSION
    MAJORVERSION := $(basename $(VERSION))
endif
$(info  MAJORVERSION is $(MAJORVERSION))


When I run the above I get:

aklaver@maura:~/test/cstore_fdw-1.7.0> PATH=/usr/local/pgsql/bin/:$PATH
make
MAJORVERSION is 12

...

and the code compiles.



> *Moses Mafusire*



--
Adrian Klaver
adrian.klaver@aklaver.com

Re: Cstore_fdw issue.

From
Adrian Klaver
Date:
On 4/3/20 9:26 AM, Moses Mafusire wrote:
> Hi Adrian,
> Yes VERSION = PostgreSQL 12.1, is the only version I have. So I am 
> novice to Linux and Postgres, where should I run this
> /ifndef MAJORVERSION
>      MAJORVERSION := $(basename $(VERSION))
> endif
> $(info  MAJORVERSION is $(MAJORVERSION))/
> 
> and do I run as is or do I need to do something else, if so may you 
> please assist.

No you can't run the above by itself. In the directory you uncompressed 
the files there will be a file named Makefile. In my case:

aklaver@maura:~/test/cstore_fdw-1.7.0> ls -al

...
-rw-r--r--  1 aklaver users  1814 Apr  3 08:37 Makefile
...

Use a text editor to open that file and add the line:

$(info  MAJORVERSION is $(MAJORVERSION))

Under the section:


ifndef MAJORVERSION
     MAJORVERSION := $(basename $(VERSION))
endif

and save.

Then run:

PATH=/usr/pgsql-12/bin/:$PATH make


> 
> Thanks
> *Moses *
> 
> On Friday, April 3, 2020, 11:39:57 AM EDT, Adrian Klaver 
> <adrian.klaver@aklaver.com> wrote:
> 
> 
> On 4/3/20 5:53 AM, Moses Mafusire wrote:
>  > Hi Adrian,
>  > Thanks for your response. Here is what I'm getting when I run 
> /pg_config;/
> 
>  > VERSION = PostgreSQL 12.1
> 
> So that is the correct version.
> 
> Just to be clear there is only one version of Postgres on this machine,
> correct?
> 
> Before you run make again, edit the Makefile so:
> 
> ifndef MAJORVERSION
>      MAJORVERSION := $(basename $(VERSION))
> endif
> 
> becomes:
> 
> ifndef MAJORVERSION
>      MAJORVERSION := $(basename $(VERSION))
> endif
> $(info  MAJORVERSION is $(MAJORVERSION))
> 
> 
> When I run the above I get:
> 
> aklaver@maura <mailto:aklaver@maura>:~/test/cstore_fdw-1.7.0> 
> PATH=/usr/local/pgsql/bin/:$PATH
> make
> MAJORVERSION is 12
> 
> ...
> 
> and the code compiles.
> 
> 
> 
>  > *Moses Mafusire*
> 
> 
> 
> -- 
> Adrian Klaver
> adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>


-- 
Adrian Klaver
adrian.klaver@aklaver.com



Re: Cstore_fdw issue.

From
Moses Mafusire
Date:
Adrian,
I really appreciate your help. I was able to open the file in a text editor in centOS, but it's read-only. I cannot even replace the file. Any tricks up your sleeves for me to edit this file.

Thanks

Moses 

On Friday, April 3, 2020, 12:40:19 PM EDT, Adrian Klaver <adrian.klaver@aklaver.com> wrote:


On 4/3/20 9:26 AM, Moses Mafusire wrote:
> Hi Adrian,
> Yes VERSION = PostgreSQL 12.1, is the only version I have. So I am
> novice to Linux and Postgres, where should I run this
> /ifndef MAJORVERSION
>      MAJORVERSION := $(basename $(VERSION))
> endif
> $(info  MAJORVERSION is $(MAJORVERSION))/
>
> and do I run as is or do I need to do something else, if so may you
> please assist.

No you can't run the above by itself. In the directory you uncompressed
the files there will be a file named Makefile. In my case:

aklaver@maura:~/test/cstore_fdw-1.7.0> ls -al

...
-rw-r--r--  1 aklaver users  1814 Apr  3 08:37 Makefile
...

Use a text editor to open that file and add the line:

$(info  MAJORVERSION is $(MAJORVERSION))

Under the section:


ifndef MAJORVERSION
    MAJORVERSION := $(basename $(VERSION))
endif

and save.

Then run:

PATH=/usr/pgsql-12/bin/:$PATH make


>
> Thanks
> *Moses *
>
> On Friday, April 3, 2020, 11:39:57 AM EDT, Adrian Klaver
> <adrian.klaver@aklaver.com> wrote:
>
>
> On 4/3/20 5:53 AM, Moses Mafusire wrote:
>  > Hi Adrian,
>  > Thanks for your response. Here is what I'm getting when I run
> /pg_config;/
>
>  > VERSION = PostgreSQL 12.1
>
> So that is the correct version.
>
> Just to be clear there is only one version of Postgres on this machine,
> correct?
>
> Before you run make again, edit the Makefile so:
>
> ifndef MAJORVERSION
>      MAJORVERSION := $(basename $(VERSION))
> endif
>
> becomes:
>
> ifndef MAJORVERSION
>      MAJORVERSION := $(basename $(VERSION))
> endif
> $(info  MAJORVERSION is $(MAJORVERSION))
>
>
> When I run the above I get:
>
> aklaver@maura <mailto:aklaver@maura>:~/test/cstore_fdw-1.7.0>
> PATH=/usr/local/pgsql/bin/:$PATH
> make
> MAJORVERSION is 12
>
> ...
>
> and the code compiles.
>
>
>
>  > *Moses Mafusire*
>
>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>

Re: Cstore_fdw issue.

From
Adrian Klaver
Date:
On 4/3/20 10:48 AM, Moses Mafusire wrote:
> Adrian,
> I really appreciate your help. I was able to open the file in a text 
> editor in centOS, but it's read-only. I cannot even replace the file. 
> Any tricks up your sleeves for me to edit this file.

Looks like a permissions issue.

In your first post you had:

[postgres@dart-centos cstore_fdw]$ PATH=/usr/pgsql-12/bin/:$PATH make

 From above I am assuming you unpacked the cstore source as the postgres 
user into the cstore_fdw directory. Is that correct?

If that is the case then you will need to open the Makefile as the 
postgres user in order to edit it.

While you are in:

[postgres@dart-centos cstore_fdw]$

run:

/usr/bin/pg_config

and

/usr/pgsql-12/bin/pg_config

and confirm they are actually returning information.

> 
> Thanks
> 
> *Moses *


-- 
Adrian Klaver
adrian.klaver@aklaver.com



Re: Cstore_fdw issue.

From
Moses Mafusire
Date:
I actually started the installation process as me. I was logged as user postgres because after trying and getting that version error message. I thought as user postgres I would be able to install, but failed). I get the same results though;

[username@dart-centos ~]$ /usr/bin/pg_config
BINDIR = /usr/bin
DOCDIR = /usr/share/doc/pgsql
HTMLDIR = /usr/share/doc/pgsql
INCLUDEDIR = /usr/include
PKGINCLUDEDIR = /usr/include/pgsql
INCLUDEDIR-SERVER = /usr/include/pgsql/server
LIBDIR = /usr/lib64
PKGLIBDIR = /usr/lib64/pgsql
LOCALEDIR = /usr/share/locale
MANDIR = /usr/share/man
SHAREDIR = /usr/share/pgsql
SYSCONFDIR = /etc
PGXS = /usr/lib64/pgsql/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--program-prefix=' '--disable-dependency-tracking' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--disable-rpath' '--with-ldap' '--with-openssl' '--with-gssapi' '--enable-nls' '--without-readline' '--datadir=/usr/share/pgsql' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'CFLAGS=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' 'LDFLAGS=-Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld' 'CXXFLAGS=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' 'PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'
CC = gcc
CPPFLAGS = -D_GNU_SOURCE
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
CFLAGS_SL = -fPIC
LDFLAGS = -Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--as-needed
LDFLAGS_EX = 
LDFLAGS_SL = 
LIBS = -lpgcommon -lpgport -lpthread -lssl -lcrypto -lgssapi_krb5 -lz -lrt -lcrypt -ldl -lm 
VERSION = PostgreSQL 12.1




[username@dart-centos ~]$ /usr/pgsql-12/bin/pg_config
BINDIR = /usr/pgsql-12/bin
DOCDIR = /usr/pgsql-12/doc
HTMLDIR = /usr/pgsql-12/doc/html
INCLUDEDIR = /usr/pgsql-12/include
PKGINCLUDEDIR = /usr/pgsql-12/include
INCLUDEDIR-SERVER = /usr/pgsql-12/include/server
LIBDIR = /usr/pgsql-12/lib
PKGLIBDIR = /usr/pgsql-12/lib
LOCALEDIR = /usr/pgsql-12/share/locale
MANDIR = /usr/pgsql-12/share/man
SHAREDIR = /usr/pgsql-12/share
SYSCONFDIR = /etc/sysconfig/pgsql
PGXS = /usr/pgsql-12/lib/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--enable-rpath' '--prefix=/usr/pgsql-12' '--includedir=/usr/pgsql-12/include' '--libdir=/usr/pgsql-12/lib' '--mandir=/usr/pgsql-12/share/man' '--datadir=/usr/pgsql-12/share' '--with-icu' '--with-llvm' '--with-perl' '--with-python' '--with-tcl' '--with-tclconfig=/usr/lib64' '--with-openssl' '--with-pam' '--with-gssapi' '--with-includes=/usr/include' '--with-libraries=/usr/lib64' '--enable-nls' '--enable-dtrace' '--with-uuid=e2fs' '--with-libxml' '--with-libxslt' '--with-ldap' '--with-selinux' '--with-systemd' '--with-system-tzdata=/usr/share/zoneinfo' '--sysconfdir=/etc/sysconfig/pgsql' '--docdir=/usr/pgsql-12/doc' '--htmldir=/usr/pgsql-12/doc/html' 'CFLAGS=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' 'LDFLAGS=-Wl,--as-needed' 'PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig' 'PYTHON=/usr/bin/python2'
CC = gcc
CPPFLAGS = -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
CFLAGS_SL = -fPIC
LDFLAGS = -Wl,--as-needed -L/usr/lib64 -L/usr/lib64 -Wl,--as-needed -Wl,-rpath,'/usr/pgsql-12/lib',--enable-new-dtags
LDFLAGS_EX = 
LDFLAGS_SL = 
LIBS = -lpgcommon -lpgport -lpthread -lselinux -lxslt -lxml2 -lpam -lssl -lcrypto -lgssapi_krb5 -lz -lreadline -lrt -lcrypt -ldl -lm 
VERSION = PostgreSQL 12.2

Thanks

Moses 


On Friday, April 3, 2020, 01:57:21 PM EDT, Adrian Klaver <adrian.klaver@aklaver.com> wrote:


On 4/3/20 10:48 AM, Moses Mafusire wrote:
> Adrian,
> I really appreciate your help. I was able to open the file in a text
> editor in centOS, but it's read-only. I cannot even replace the file.
> Any tricks up your sleeves for me to edit this file.

Looks like a permissions issue.

In your first post you had:

[postgres@dart-centos cstore_fdw]$ PATH=/usr/pgsql-12/bin/:$PATH make

From above I am assuming you unpacked the cstore source as the postgres
user into the cstore_fdw directory. Is that correct?

If that is the case then you will need to open the Makefile as the
postgres user in order to edit it.

While you are in:

[postgres@dart-centos cstore_fdw]$

run:

/usr/bin/pg_config

and

/usr/pgsql-12/bin/pg_config

and confirm they are actually returning information.


>
> Thanks
>
> *Moses *


--
Adrian Klaver
adrian.klaver@aklaver.com


Re: Cstore_fdw issue.

From
Adrian Klaver
Date:
On 4/3/20 11:52 AM, Moses Mafusire wrote:
> I actually started the installation process as me. I was logged as user 
> postgres because after trying and getting that version error message. I 
> thought as user postgres I would be able to install, but failed). I get 
> the same results though;

Yes, but you where doing the compile as the postgres user. That is where 
the error was being shown. In order to troubleshoot this you need to 
stick to consistent set of operations. Jumping around as different user 
does not count:)

So:

1) Pick a user.

2) Unpack the source as that user in the users home directory. If not 
already done.

3) In the unpacked source directory run:

/usr/bin/pg_config

and

/usr/pgsql-12/bin/pg_config

4) Then:

PATH=/usr/bin/:$PATH make

Preferably with the modification to the Makefile I suggested upstream.



-- 
Adrian Klaver
adrian.klaver@aklaver.com



Re: Cstore_fdw issue.

From
Adrian Klaver
Date:
On 4/3/20 11:52 AM, Moses Mafusire wrote:
> I actually started the installation process as me. I was logged as user 
> postgres because after trying and getting that version error message. I 
> thought as user postgres I would be able to install, but failed). I get 
> the same results though;

Dawned on me that I may guilty of assuming. Have you installed the 
CentOS development packages?:

https://www.scalescale.com/tips/nginx/install-gcc-development-tools-centos-7/



-- 
Adrian Klaver
adrian.klaver@aklaver.com



Re: Cstore_fdw issue.

From
Devrim Gündüz
Date:
Hi,

On Thu, 2020-04-02 at 20:40 +0000, Moses Mafusire wrote:
> Hi,I am new to PostgreSQL, successfully installed PGSql v12.2 on my CentOS 7
> machine and I am trying to install cstore_fdw.

yum install cstore_fdw_12

Regards,
--
Devrim Gündüz
Open Source Solution Architect, Red Hat Certified Engineer
Twitter: @DevrimGunduz , @DevrimGunduzTR

Attachment

Re: Cstore_fdw issue.

From
Devrim Gündüz
Date:
Hi,

On Thu, 2020-04-02 at 20:40 +0000, Moses Mafusire wrote:
>
>     3. I have searched for pg_config directory and found 2 locations;
>         /usr/bin/pg_config        /usr/pgsql-12/bin/pg_config

BTW, I think both the OS-supplied and the community packages are installed at
the same time, because community packages do not put pg_config under /usr/bin.

rpm -qa|grep postgresql

will probably tell you that 9.2 is also installed. In this case, I'd do these:

* yum remove postgresql-*
* yum reinstall postgresql12*

The 2nd step is needed to restore the broken links.

Regards,
--
Devrim Gündüz
Open Source Solution Architect, Red Hat Certified Engineer
Twitter: @DevrimGunduz , @DevrimGunduzTR

Attachment