Thread: PLPerl - Undefined symbol "MemoryContextSwitchTo"

PLPerl - Undefined symbol "MemoryContextSwitchTo"

From
Doug Sampson
Date:
Due to database corruption, I had to rebuild a database. Originally we
installed PGSQL 7.4 and over the years bumped it up to 8.0. Now I would like
to use 8.4.

I'm trying to apply the plperl language to a 8.4.0_1 SQL_ASCII database and
I keep getting this error message:

orion-root@/home/postgres: createlang plperl erp
createlang: language installation failed: ERROR:  could not load library
"/usr/local/lib/postgresql/plperl.so": dlopen
(/usr/local/lib/postgresql/plperl.so) failed:
/usr/local/lib/postgresql/plperl.so: Undefined symbol
"MemoryContextSwitchTo"

I checked to see if p5-postgresql-plperl was installed and it wasn't.

orion-root@/usr/ports: portversion -v | grep p5-postgresql-plperl
orion-root@/usr/ports:

I noticed this:

orion-root@/usr/ports: make search name=postgresql-plperl
Port:   postgresql-plperl-7.4.25_1
Path:   /usr/ports/databases/p5-postgresql-plperl
Info:   Write SQL functions for PostgreSQL using Perl5
Maint:  girgen@FreeBSD.org
B-deps: gettext-0.17_1 gmake-3.81_3 libiconv-1.13.1 perl-5.8.9_3
R-deps: gettext-0.17_1 libiconv-1.13.1 perl-5.8.9_3 postgresql-client-7.4.25
postgresql-server-7.4.25
WWW:    http://www.postgresql.org/

I find this surprising that the plperl module depends on an older version of
PGSQL! Perl 5.8.9 is also depended on. I'm running Perl 5.10.1.

orion-root@/home/postgres: uname -a
FreeBSD orion.dawnsign.com 7.1-RELEASE-p3 FreeBSD 7.1-RELEASE-p3 #3: Fri Feb
27 14:11:28 PST 2009
root@orion.dawnsign.com:/usr/obj/usr/src/sys/ORION-SMP  i386

Does this mean I have to revert back to the older version of PGSQL as well
as an older version of Perl in order to install plperl language support?

~Doug

Re: PLPerl - Undefined symbol "MemoryContextSwitchTo"

From
Tom Lane
Date:
Doug Sampson <dougs@dawnsign.com> writes:
> orion-root@/usr/ports: make search name=postgresql-plperl
> Port:   postgresql-plperl-7.4.25_1

It would appear that you forgot to update plperl to 8.4 along with
the core postgres package ... the error message is not tremendously
informative but it seems consistent with the idea of trying to load
a 7.4-vintage plperl.so into a modern backend.

            regards, tom lane

Re: PLPerl - Undefined symbol "MemoryContextSwitchTo"

From
Doug Sampson
Date:
> Doug Sampson <dougs@dawnsign.com> writes:
> > orion-root@/usr/ports: make search name=postgresql-plperl
> > Port:   postgresql-plperl-7.4.25_1
>
> It would appear that you forgot to update plperl to 8.4 along with
> the core postgres package ... the error message is not tremendously
> informative but it seems consistent with the idea of trying to load
> a 7.4-vintage plperl.so into a modern backend.
>

I'm no PGSQL expert. Neither am I a FreeBSD expert.

How does one build plperl support into a FreeBSD port of postgresql-server
8.4? Here's what 'make config' shows:


+--------------------------------------------------------------------+
                    |              Options for postgresql-server 8.4.0_1
|
                    |
+----------------------------------------------------------------+ |
                    | |[X] NLS               Use internationalized messages
| |
                    | |[X] PAM               Build with PAM support (server
only)      | |
                    | |[ ] LDAP              Build with LDAP authentication
support    | |
                    | |[ ] MIT_KRB5          Build with MIT's kerberos
support         | |
                    | |[ ] HEIMDAL_KRB5      Builds with Heimdal kerberos
support      | |
                    | |[X] OPTIMIZED_CFLAGS  Builds with compiler
optimizations (-O3)  | |
                    | |[X] XML               Build with XML data type
(server)         | |
                    | |[X] TZDATA            Use internal timezone database
(server)   | |
                    | |[ ] DEBUG             Builds with debugging symbols
| |
                    | |[ ] INTDATE           Builds with 64-bit date/time
type (server)| |
                    | |
| |
                    | |
| |
                    | |
| |
                    | |
| |
                    | |
| |

+-+----------------------------------------------------------------+-+
                    |                       [  OK  ]       Cancel
|

+--------------------------------------------------------------------+

Or am I going about this the wrong way? Should I install the
p5-postgresql-plperl port even though it states that this ports depends on
or are depended by postgresql 7.4 server/client and perl 5.8.9? Will the
p5-postgresql-plperl work with version 8.4.0_1 of PGSQL and Perl 5.10.1?

~Doug

Re: PLPerl - Undefined symbol "MemoryContextSwitchTo"

From
Doug Sampson
Date:
> > Doug Sampson <dougs@dawnsign.com> writes:
> > > orion-root@/usr/ports: make search name=postgresql-plperl
> > > Port:   postgresql-plperl-7.4.25_1
> >
> > It would appear that you forgot to update plperl to 8.4 along with
> > the core postgres package ... the error message is not tremendously
> > informative but it seems consistent with the idea of trying to load
> > a 7.4-vintage plperl.so into a modern backend.
> >
>
> I'm no PGSQL expert. Neither am I a FreeBSD expert.
>
> How does one build plperl support into a FreeBSD port of
> postgresql-server

 [...]

>
> Or am I going about this the wrong way? Should I install the
> p5-postgresql-plperl port even though it states that this
> ports depends on
> or are depended by postgresql 7.4 server/client and perl
> 5.8.9? Will the
> p5-postgresql-plperl work with version 8.4.0_1 of PGSQL and
> Perl 5.10.1?
>
> ~Doug
>

I went ahead and installed the p5-postgresql-plperl port and it installed
cleanly. The 'createlang plperl erp' command went through fine. The
installation recognized correctly the current versions of both PGSQL and
Perl and used them.

I am puzzled though as to why it wasn't installed previously for the older
version of PGSQL which apparently had PLPerl support!

Thanks for the assistance!

~Doug