Issue with installing postgres extension
I am having issues with postgres extensions and I have already installed the contrib package. thank you for the help!! postgres=# CREATE EXTENSION pg_stat_statements; ERROR: could not load library "/home/postgres/bin/pgsql/15/lib/pg_stat_statements.so": /home/postgres/bin/pgsql/15/lib/pg_stat_statements.so: undefined symbol: InitMaterializedSRF postgres=# postgres=# exit [postgres@postgres ~]$ rpm -q postgresql15-contrib postgresql15-contrib-15.7-3PGDG.rhel8.x86_64 [postgres@postgres ~]$ pg_config BINDIR = /home/postgres/bin/pgsql/15/bin DOCDIR = /home/postgres/bin/pgsql/15/share/doc HTMLDIR = /home/postgres/bin/pgsql/15/share/doc INCLUDEDIR = /home/postgres/bin/pgsql/15/include PKGINCLUDEDIR = /home/postgres/bin/pgsql/15/include INCLUDEDIR-SERVER = /home/postgres/bin/pgsql/15/include/server LIBDIR = /home/postgres/bin/pgsql/15/lib PKGLIBDIR = /home/postgres/bin/pgsql/15/lib LOCALEDIR = /home/postgres/bin/pgsql/15/share/locale MANDIR = /home/postgres/bin/pgsql/15/share/man SHAREDIR = /home/postgres/bin/pgsql/15/share SYSCONFDIR = /home/postgres/bin/pgsql/15/etc PGXS = /home/postgres/bin/pgsql/15/lib/pgxs/src/makefiles/pgxs.mk CONFIGURE = '--prefix=/home/postgres/bin/pgsql/15' CC = gcc CPPFLAGS = -D_GNU_SOURCE CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O2 CFLAGS_SL = -fPIC LDFLAGS = -Wl,--as-needed -Wl,-rpath,'/home/postgres/bin/pgsql/15/lib',--enable-new-dtags LDFLAGS_EX = LDFLAGS_SL = LIBS = -lpgcommon -lpgport -lz -lreadline -lpthread -lrt -ldl -lm VERSION = PostgreSQL 15.0 [postgres@postgres ~]$ cd /home/postgres/bin/pgsql/15/lib [postgres@postgres lib]$ ls cyrillic_and_mic.solibecpg.a libpgcommon_shlib.a libpq.soplpgsql.soutf8_and_gb18030.so dict_snowball.so libecpg_compat.alibpgfeutils.a libpq.so.5 repmgr.so utf8_and_gbk.so euc2004_sjis2004.solibecpg_compat.so libpgport.a libpq.so.5.15 utf8_and_big5.so utf8_and_iso8859_1.so euc_cn_and_mic.so libecpg_compat.so.3 libpgport_shlib.a libpqwalreceiver.so utf8_and_cyrillic.so utf8_and_iso8859.so euc_jp_and_sjis.so libecpg_compat.so.3.15 libpgtypes.a pgoutput.so utf8_and_euc2004.so utf8_and_johab.so euc_kr_and_mic.so libecpg.so libpgtypes.so pg_stat_statements.control utf8_and_euc_cn.soutf8_and_sjis2004.so euc_tw_and_big5.so libecpg.so.6libpgtypes.so.3 pg_stat_statements.so utf8_and_euc_jp.soutf8_and_sjis.so latin2_and_win1250.so libecpg.so.6.15 libpgtypes.so.3.15 pgxs utf8_and_euc_kr.soutf8_and_uhc.so latin_and_mic.so libpgcommon.a libpq.a pkgconfig utf8_and_euc_tw.soutf8_and_win.so [postgres@postgres lib]$ psqll bash: psqll: command not found... Similar command is: 'psql' [postgres@postgres lib]$ psql psql (15.7, server 15.0) Type "help" for help. postgres=# -- Thanks & Regards, BHAVANI DHULIPALLA (973)-615-0290
Re: Issue with installing postgres extension
thank you for tom for your response. i dont remember installing postgres 14 version on the server and it seems like I have postgres 15 running. Please see below. [postgres@postgres ~]$ psql psql (15.7, server 15.0) Type "help" for help. postgres=# postgres=# CREATE EXTENSION pg_stat_statements; ERROR: could not load library "/home/postgres/bin/pgsql/15/lib/pg_stat_statements.so": /home/postgres/bin/pgsql/15/lib/pg_stat_statements.so: undefined symbol: InitMaterializedSRF postgres=# postgres=# SELECT version(); version PostgreSQL 15.0 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.3.1 20191121 (Red Hat 8.3.1-5.0.1), 64-bit (1 row) On Wed, Jun 26, 2024 at 7:43 PM Tom Lane wrote: > bhavani dba writes: > > postgres=# CREATE EXTENSION pg_stat_statements; > > ERROR: could not load library > > "/home/postgres/bin/pgsql/15/lib/pg_stat_statements.so": > > /home/postgres/bin/pgsql/15/lib/pg_stat_statements.so: undefined symbol: > > InitMaterializedSRF > > This certainly looks like you are trying to load a v15 extension > into a pre-v15 server (since the InitMaterializedSRF function > didn't exist in prior versions). > > I'm going to go out on a limb and guess that you just installed > v15 and forgot to restart the server, so that what's running is > still v14 or before. If so, you probably also forgot the > pg_upgrade step --- you can't simply start a new major version > in an old one's data directory. > > regards, tom lane > -- Thanks & Regards, BHAVANI DHULIPALLA (973)-615-0290
Re: Issue with installing postgres extension
Thank you , installing postgres16 on my server. Thanks, Bhavani On Wed, Jun 26, 2024 at 10:25 PM Tom Lane wrote: > bhavani dba writes: > > thank you for tom for your response. i dont remember installing postgres > 14 > > version on the server and it seems like I have postgres 15 running. > > > [postgres@postgres ~]$ psql > > psql (15.7, server 15.0) > > Type "help" for help. > > Hmm ... after poking around a bit, it appears you are trying to load > extension code compiled against 15.1 or later into a 15.0 server. > Possibly we should have thought a bit harder about the compatibility > implications of commit f2f7e509e. Nonetheless, what are you doing > running a 15.0 server? That was many minor releases and bug fixes > ago. > > regards, tom lane > -- Thanks & Regards, BHAVANI DHULIPALLA (973)-615-0290
Re: Issue with installing postgres extension
thank you Tom!!!, I installed postgres 16 and was able to get the extension installed. On Wed, Jun 26, 2024 at 10:46 PM bhavani dba wrote: > Thank you , installing postgres16 on my server. > > Thanks, > Bhavani > > On Wed, Jun 26, 2024 at 10:25 PM Tom Lane wrote: > >> bhavani dba writes: >> > thank you for tom for your response. i dont remember installing >> postgres 14 >> > version on the server and it seems like I have postgres 15 running. >> >> > [postgres@postgres ~]$ psql >> > psql (15.7, server 15.0) >> > Type "help" for help. >> >> Hmm ... after poking around a bit, it appears you are trying to load >> extension code compiled against 15.1 or later into a 15.0 server. >> Possibly we should have thought a bit harder about the compatibility >> implications of commit f2f7e509e. Nonetheless, what are you doing >> running a 15.0 server? That was many minor releases and bug fixes >> ago. >> >> regards, tom lane >> > > > -- > Thanks & Regards, > > BHAVANI DHULIPALLA > (973)-615-0290 > -- Thanks & Regards, BHAVANI DHULIPALLA (973)-615-0290