From: | Peter Wullinger <some-mail-drop(at)gmx(dot)net> |
---|---|
To: | Jessica Ditt <jessica(dot)ditt(at)web(dot)de>, pgsql-de-allgemein(at)postgresql(dot)org, seltenreich(at)gmx(dot)de |
Subject: | Re: Neuladen von shared objects ??? |
Date: | 2005-05-27 17:23:27 |
Message-ID: | 20050527172326.GA3739@peter.home.wul |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-de-allgemein |
In epistula a Andreas Seltenreich, die horaque Fri, May 27, 2005 at 03:31:37PM +0200:
> Jessica Ditt schrob:
>
> > Nachdem ich gerade erst dachte, LOAD würde mein Problem beheben, wurde
> > ich gerade eines Besseren belehrt.
> > Trotz erneuten Ladens der shared object-Dateien werden nach wie vor die
> > alten Funktionen ausgeführt.
>
Aus Spaß an der Freude hab ich das mal ausprobiert:
PostgreSQL 8.0.4, FreeBSD 5.4-STABLE, ufs (softupdates)
= pgsql_hello_world.c ==
#include "postgres.h"
#include "fmgr.h"
PG_FUNCTION_INFO_V1(hello_world);
Datum
hello_world(PG_FUNCTION_ARGS)
{
elog(NOTICE, "Hello, world, first version!");
PG_RETURN_INT32(0);
}
= pgsql_hello_world.c ==
% gcc -I/<postgres>/include/server -L<postgres>/lib \
-W -Wall -Wl,-shared -o pgsql_notice.so pgsql_notice.c
psql: ~# CREATE OR REPLACE FUNCTION hello_world()
RETURNS INTEGER LANGUAGE 'C' AS
'/tmp/pgsql_hello_world.so', 'hello_world';
psql: ~# select hello_world();
NOTICE: Hello, world, first version!
= pgsql_hello_world.c ==
#include "postgres.h"
#include "fmgr.h"
PG_FUNCTION_INFO_V1(hello_world);
Datum
hello_world(PG_FUNCTION_ARGS)
{
elog(NOTICE, "Hello, world, second version!");
PG_RETURN_INT32(0);
}
= pgsql_hello_world.c ==
% gcc -I/<postgres>/include/server -L<postgres>/lib \
-W -Wall -Wl,-shared -o pgsql_pgsql_notice.so pgsql_hello_world.c
(in derselben Sitzung):
psql: ~# select hello_world();
NOTICE: Hello, world, first version!
psql: ~# LOAD '/tmp/pgsql_hello_world.so';
psql: ~# select hello_world();
NOTICE: Hello, world, second version!
= pgsql_hello_world.c ==
#include "postgres.h"
#include "fmgr.h"
PG_FUNCTION_INFO_V1(hello_world);
Datum
hello_world(PG_FUNCTION_ARGS)
{
elog(NOTICE, "Hello, world, third version!");
PG_RETURN_INT32(0);
}
= pgsql_hello_world.c ==
% gcc -I/<postgres>/include/server -L<postgres>/lib \
-W -Wall -Wl,-shared -o pgsql_pgsql_notice.so pgsql_hello_world.c
(in neuer Sitzung)
psql: ~# select hello_world();
NOTICE: Hello, world, third version!
> Bist du sicher, daß die Library auch korrekt neu übersetzt, und an der
> richtigen Stelle abgelegt wurde? Möglicherweise ist es doch ein Bug in
> deinem Makefile o.ä.? Ist das ganze vielleicht auf einem störrischen
> Dateisystem (Samba, NFS, etc)?
Würde ich auch mal tippen. Wobei ich auch einige Journaling-Dateisysteme
(lacht nicht) zu dem problematischen zählen würde. Dort nimmt man es
mit der Synchronisierbarkeit für Benutzerprogramme oft auch nicht
mehr so genau.
Gruß,
Peter
--
Strebe nicht nach der Gunst der Menge, denn diese ist selten auf
ehrenvolle und rechtmäßige Weise erlangt. Suche stattdessen das
Zeugnis weniger und zähle nicht die Stimmen, sondern gewichte sie.
-- Immanuel Kant
From | Date | Subject | |
---|---|---|---|
Next Message | Winnie Lake | 2005-05-27 18:06:49 | Over 80% Savings on ALL best-selling Photoshop titles |
Previous Message | Andreas Seltenreich | 2005-05-27 13:31:37 | Re: Neuladen von shared objects ??? |