Thread: PL/Perl on Solaris

PL/Perl on Solaris

From
Travis Bauer
Date:
Could anyone give me an example of how to compile perl for use
with the latest version of postgresql on Solaris 8?

Specifically, I need to know the options to give the Configure
script.  Currently I'm trying:

sh Configure -de -Duseshrplib -Dprefix=/a/path/perl -Dusemymalloc -Accflags=-DPERL_POLLUTE

It compiles and installs okay, and I can get plperl compiled and
installed.  And I can create a perl function okay.  But when I
try to run the function in psql, the backend crashes.

I had this working before, and I vaguely remember it had
something to do with a pollution parameter, but I'm not
sure.

Thanks,


--
----------------------------------------------------------------
Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer
----------------------------------------------------------------

Re: PL/Perl on Solaris

From
Peter Eisentraut
Date:
Travis Bauer writes:

> Could anyone give me an example of how to compile perl for use
> with the latest version of postgresql on Solaris 8?

I don't have one, but the requirement to recompile Perl is actually a
myth for most platforms.  You could alter the Makefile.PL for PL/Perl and
remove the shared library check and see if it works.

> It compiles and installs okay, and I can get plperl compiled and
> installed.  And I can create a perl function okay.  But when I
> try to run the function in psql, the backend crashes.

Backtraces can be helpful.

--
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter


Re: PL/Perl on Solaris

From
Alex Pilosov
Date:
All sounds ok. Please get a traceback of the crash using gdb, and post
it....


-alex

On Fri, 10 Aug 2001, Travis Bauer wrote:

> Could anyone give me an example of how to compile perl for use
> with the latest version of postgresql on Solaris 8?
>
> Specifically, I need to know the options to give the Configure
> script.  Currently I'm trying:
>
> sh Configure -de -Duseshrplib -Dprefix=/a/path/perl -Dusemymalloc -Accflags=-DPERL_POLLUTE
>
> It compiles and installs okay, and I can get plperl compiled and
> installed.  And I can create a perl function okay.  But when I
> try to run the function in psql, the backend crashes.
>
> I had this working before, and I vaguely remember it had
> something to do with a pollution parameter, but I'm not
> sure.
>
> Thanks,
>
>
>


Re: PL/Perl on Solaris

From
Travis Bauer
Date:
Peter Eisentraut (peter_e@gmx.net) wrote:

> Travis Bauer writes:
>
> I don't have one, but the requirement to recompile Perl is actually a
> myth for most platforms.  You could alter the Makefile.PL for PL/Perl and
> remove the shared library check and see if it works.
>
It did compile and install plper.so in the lib directory.  But when I
try to create a function, it complains that:

ERROR:  Can't find function plperl_call_handler in file
/mypath/perl5/5.6.0/sun4-solaris/CORE/libperl.so


>
> Backtraces can be helpful.
> --

The postmaster restarts itself and does not seem to be leaving
any core file behind for gdb to study.

////////////////////////////////////////////////////////////////////////
Using my custom compile of perl:
Here the error that psql gets (includes script):

swell:bin$ createdb trbauer
CREATE DATABASE
swell:bin$ psql
Welcome to psql, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help on internal slash commands
       \g or terminate with semicolon to execute query
       \q to quit

trbauer=# CREATE FUNCTION "plperl_call_handler" () RETURNS opaque AS
'/apath/postgresql-7.1.2/lib/plperl.so', 'plperl_call_handler' LANGUAGE 'C';
CREATE
trbauer=# CREATE TRUSTED PROCEDURAL LANGUAGE 'plperl' HANDLER
"plperl_call_handler" LANCOMPILER 'PL/Perl';
CREATE
trbauer=# CREATE FUNCTION "cosine_sim" (text,text) RETURNS float as
'return 1.0;' LANGUAGE 'plperl';
CREATE
trbauer=# select cosine_sim('aword', 'aword');
pqReadData() -- backend closed the channel unexpectedly.
        This probably means the backend terminated abnormally
        before or while processing the request.
The connection to the server was lost. Attempting reset: NOTICE:  Message
from PostgreSQL backend:
        The Postmaster has informed me that some other backend  died abnormally
and possibly corrupted shared memory.
        I have rolled back the current transaction and am
going to terminate your database system connection and exit.
        Please reconnect to the database system and repeat your query.
Failed.
!#

/////////////////////////////////////////////////////////////////////////////
Here is what the postmaster spits out:

swell:trbauer$ pg_ctl start -o "-i"
postmaster successfully started
swell:trbauer$ DEBUG:  database system was shut down at 2001-08-10 12:36:49 EST
DEBUG:  CheckPoint record at (0, 9990872)
DEBUG:  Redo record at (0, 9990872); Undo record at (0, 0); Shutdown TRUE
DEBUG:  NextTransactionId: 1675; NextOid: 85746
DEBUG:  database system is in production state
Server process (pid 1506) exited with status 139 at Fri Aug 10 12:41:00 2001
Terminating any active server processes...
NOTICE:  Message from PostgreSQL backend:
        The Postmaster has informed me that some other backend  died abnormally
    and possibly corrupted shared memory.
        I have rolled back the current transaction and am
    going to terminate your database system connection and exit.
        Please reconnect to the database system and repeat your query.
Server processes were terminated at Fri Aug 10 12:41:00 2001
Reinitializing shared memory and semaphores
DEBUG:  database system was interrupted at 2001-08-10 12:37:14 EST
DEBUG:  CheckPoint record at (0, 9990872)
DEBUG:  Redo record at (0, 9990872); Undo record at (0, 0); Shutdown TRUE
DEBUG:  NextTransactionId: 1675; NextOid: 85746
DEBUG:  database system was not properly shut down; automatic recovery in
    progress...
DEBUG:  redo starts at (0, 9990936)
DEBUG:  ReadRecord: record with zero len at (0, 10074184)
DEBUG:  redo done at (0, 10074144)
DEBUG:  database system is in production state

How do I get the postmaster to leave behind a core file for gdb to
analyze?  Is the above helpful at all? I do have plperl working on
an earlier version of solaris.

Thanks,
--
----------------------------------------------------------------
Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer
----------------------------------------------------------------

Boolean Constants Implicit?

From
Date:
Good day,

The on-line documentation lists that PostgreSQL supports only four
implicitly typed constants: string, bit string, integer and floating
point.

Doesn't boolean (true/false) qualify as an implicitly typed as well, as
it doesn't need to be bound by single quotes? For example:

lx=# SELECT true AS bool_const_t, false AS bool_const_f;
 bool_const_t | bool_const_f
--------------+--------------
 t            | f
(1 row)

lx=#

Is this documentation just out of date? Thoughts? ;)


Regards,
Jw.
--
jlx@commandprompt.com by way of pgsql-general@commandprompt.com