Обсуждение: preload libraries

Поиск
Список
Период
Сортировка

preload libraries

От
flickchick_one
Дата:
Hello all -
 
I'm attempting to preload a shared object file (match.so) in order to create a C function in postgres that use will use it.  To do this, I've added the following line to the postgresql.conf file:
 
preload_libraries = '/etc/postgresql/8.1/main/match.so'
 
Now when attempting to start the server, I receive the following error message:
 
Postgresql server failed to start.  Please check the log output:
 
Although the message says to check the log for additional info, and a log is created for the event, the file is empty.
 
I'm very new to postgres, so I'm wondering if there's some sort of permission problem that I need to address. 
 
One note - if I comment out the preload_libraries line, the server starts and runs fine.  But if I then attempt to create the function that calls match.so, the server will crash with the following error message:
 
An error has occurred:
server closed the connection unexpectedly
          This probably means the server terminated abnormally
          before or while processing the request.
 
Again there are no details in the log to explain what is happening.
 
Thanks in advance for any assistance you can provide.
 
Chris
 
 


Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's on, when.

Re: preload libraries

От
"Joshua D. Drake"
Дата:
flickchick_one wrote:
> Hello all -
>
> I'm attempting to preload a shared object file (match.so) in order to
> create a C function in postgres that use will use it.  To do this, I've
> added the following line to the postgresql.conf file:

You don't have to preload match.so to use it. Just create the function
that calls it :)

Joshua D. Drake


>
> preload_libraries = '/etc/postgresql/8.1/main/match.so'
>
> Now when attempting to start the server, I receive the following error
> message:
>
> Postgresql server failed to start.  Please check the log output:
>
> Although the message says to check the log for additional info, and a
> log is created for the event, the file is empty.
>
> I'm very new to postgres, so I'm wondering if there's some sort of
> permission problem that I need to address.
>
> One note - if I comment out the preload_libraries line, the server
> starts and runs fine.  But if I then attempt to create the function that
> calls match.so, the server will crash with the following error message:
>
> An error has occurred:
> server closed the connection unexpectedly
>           This probably means the server terminated abnormally
>           before or while processing the request.
>
> Again there are no details in the log to explain what is happening.
>
> Thanks in advance for any assistance you can provide.
>
> Chris
>
>
>
> ------------------------------------------------------------------------
> Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge
> <http://us.rd.yahoo.com/evt=47093/*http://tv.yahoo.com/collections/222>to
> see what's on, when.


--

       === The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive  PostgreSQL solutions since 1997
              http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/


Re: preload libraries

От
Tom Lane
Дата:
flickchick_one <flickchick_one@yahoo.com> writes:
>   I'm attempting to preload a shared object file (match.so) in order to create a C function in postgres that use will
useit.  To do this, I've added the following line to the postgresql.conf file: 

>   preload_libraries = '/etc/postgresql/8.1/main/match.so'

>   Now when attempting to start the server, I receive the following error message:

>   Postgresql server failed to start.  Please check the log output:

>   Although the message says to check the log for additional info, and a log is created for the event, the file is
empty.

The error message is most likely going to postmaster's stderr, which
might or might not be captured by whatever logging setup you're using.
Try starting the postmaster "by hand", ie just "postmaster -D wherever",
and see if you get anything useful.

It sounds like it's probably an object-file compatibility problem, but
need the message to guess exactly what...

            regards, tom lane

Re: preload libraries

От
flickchick_one
Дата:
i've gone another direction on the issue, but am continuing to have problems with it.  this time i've put my shared object file in the preferred location according to the pg_config command, then i'm attempting to create the function.  i do have log output now, and am wondering if someone has an idea where to go with this.  thanks in advance for your assistance.

Log file output:

<postgres - 2007-06-09 15:53:23 CDT>STATEMENT:  CREATE FUNCTION match(text, text) RETURNS BOOLEAN
        AS 'match.so', 'match'
        LANGUAGE 'C';
< - 2007-06-09 15:53:23 CDT>DEBUG:  00000: server process (PID 27181) was terminated by signal 11
< - 2007-06-09 15:53:23 CDT>LOCATION:  LogChildExit, postmaster.c:2432
< - 2007-06-09 15:53:23 CDT>LOG:  00000: server process (PID 27181) was terminated by signal 11
< - 2007-06-09 15:53:23 CDT>LOCATION:  LogChildExit, postmaster.c:2432
< - 2007-06-09 15:53:23 CDT>LOG:  00000: terminating any other active server processes
< - 2007-06-09 15:53:23 CDT>LOCATION:  HandleChildCrash, postmaster.c:2313
< - 2007-06-09 15:53:23 CDT>DEBUG:  00000: sending SIGQUIT to process 27168
< - 2007-06-09 15:53:23 CDT>LOCATION:  HandleChildCrash, postmaster.c:2352
< - 2007-06-09 15:53:23 CDT>DEBUG:  00000: sending SIGQUIT to process 27154
< - 2007-06-09 15:53:23 CDT>LOCATION:  HandleChildCrash, postmaster.c:2352
<postgres - 2007-06-09 15:53:23 CDT>WARNING:  57P02: terminating connection because of crash of another server process
<postgres - 2007-06-09 15:53:23 CDT>DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
<postgres - 2007-06-09 15:53:23 CDT>HINT:  In a moment you should be able to reconnect to the database and repeat your command.
<postgres - 2007-06-09 15:53:23 CDT>LOCATION:  quickdie, postgres.c:2118
< - 2007-06-09 15:53:23 CDT>DEBUG:  00000: sending SIGQUIT to process 27064
< - 2007-06-09 15:53:23 CDT>LOCATION:  HandleChildCrash, postmaster.c:2366
< - 2007-06-09 15:53:23 CDT>DEBUG:  00000: sending SIGQUIT to process 27065
< - 2007-06-09 15:53:23 CDT>LOCATION:  HandleChildCrash, postmaster.c:2400
< - 2007-06-09 15:53:23 CDT>DEBUG:  00000: server process (PID 27154) exited with exit code 1
< - 2007-06-09 15:53:23 CDT>LOCATION:  LogChildExit, postmaster.c:2423
<postgres - 2007-06-09 15:53:23 CDT>WARNING:  57P02: terminating connection because of crash of another server process
<postgres - 2007-06-09 15:53:23 CDT>DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
<postgres - 2007-06-09 15:53:23 CDT>HINT:  In a moment you should be able to reconnect to the database and repeat your command.
<postgres - 2007-06-09 15:53:23 CDT>LOCATION:  quickdie, postgres.c:2118
< - 2007-06-09 15:53:23 CDT>DEBUG:  00000: server process (PID 27168) exited with exit code 1
< - 2007-06-09 15:53:23 CDT>LOCATION:  LogChildExit, postmaster.c:2423
< - 2007-06-09 15:53:23 CDT>LOG:  00000: all server processes terminated; reinitializing
< - 2007-06-09 15:53:23 CDT>LOCATION:  reaper, postmaster.c:2213
< - 2007-06-09 15:53:23 CDT>LOG:  00000: database system was interrupted at 2007-06-09 15:52:43 CDT
< - 2007-06-09 15:53:23 CDT>LOCATION:  StartupXLOG, xlog.c:4373
< - 2007-06-09 15:53:23 CDT>LOG:  00000: checkpoint record is at 0/69E64C
< - 2007-06-09 15:53:23 CDT>LOCATION:  StartupXLOG, xlog.c:4441
< - 2007-06-09 15:53:23 CDT>LOG:  00000: redo record is at 0/69E64C; undo record is at 0/0; shutdown FALSE
< - 2007-06-09 15:53:23 CDT>LOCATION:  StartupXLOG, xlog.c:4468
< - 2007-06-09 15:53:23 CDT>LOG:  00000: next transaction ID: 2795; next OID: 57344
< - 2007-06-09 15:53:23 CDT>LOCATION:  StartupXLOG, xlog.c:4471
< - 2007-06-09 15:53:23 CDT>LOG:  00000: next MultiXactId: 1; next MultiXactOffset: 0
< - 2007-06-09 15:53:23 CDT>LOCATION:  StartupXLOG, xlog.c:4474
< - 2007-06-09 15:53:23 CDT>LOG:  00000: database system was not properly shut down; automatic recovery in progress
< - 2007-06-09 15:53:23 CDT>LOCATION:  StartupXLOG, xlog.c:4531
< - 2007-06-09 15:53:23 CDT>LOG:  00000: redo starts at 0/69E690
< - 2007-06-09 15:53:23 CDT>LOCATION:  StartupXLOG, xlog.c:4568
< - 2007-06-09 15:53:23 CDT>LOG:  00000: record with zero length at 0/710054
< - 2007-06-09 15:53:23 CDT>LOCATION:  ReadRecord, xlog.c:2763
< - 2007-06-09 15:53:23 CDT>LOG:  00000: redo done at 0/71002C
< - 2007-06-09 15:53:23 CDT>LOCATION:  StartupXLOG, xlog.c:4626
< - 2007-06-09 15:53:23 CDT>LOG:  00000: database system is ready
< - 2007-06-09 15:53:23 CDT>LOCATION:  StartupXLOG, xlog.c:4820
< - 2007-06-09 15:53:23 CDT>LOG:  00000: transaction ID wrap limit is 2147484146, limited by database "postgres"
< - 2007-06-09 15:53:23 CDT>LOCATION:  SetTransactionIdLimit, varsup.c:234


----- Original Message ----
From: Tom Lane <tgl@sss.pgh.pa.us>
To: flickchick_one <flickchick_one@yahoo.com>
Cc: pgsql-admin@postgresql.org
Sent: Tuesday, May 22, 2007 12:43:03 PM
Subject: Re: [ADMIN] preload libraries

flickchick_one <flickchick_one@yahoo.com> writes:
>   I'm attempting to preload a shared object file (match.so) in order to create a C function in postgres that use will use it.  To do this, I've added the following line to the postgresql.conf file:
  
>   preload_libraries = '/etc/postgresql/8.1/main/match.so'
  
>   Now when attempting to start the server, I receive the following error message:
  
>   Postgresql server failed to start.  Please check the log output:
  
>   Although the message says to check the log for additional info, and a log is created for the event, the file is empty.

The error message is most likely going to postmaster's stderr, which
might or might not be captured by whatever logging setup you're using.
Try starting the postmaster "by hand", ie just "postmaster -D wherever",
and see if you get anything useful.

It sounds like it's probably an object-file compatibility problem, but
need the message to guess exactly what...

            regards, tom lane



Yahoo! oneSearch: Finally, mobile search that gives answers, not web links.