Recreate C functions?

Поиск
Список
Период
Сортировка
От Elliot Chance
Тема Recreate C functions?
Дата
Msg-id 4080B84C-B6AD-4C05-A36A-1B198AC7A81B@gmail.com
обсуждение исходный текст
Ответы Re: Recreate C functions?  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: Recreate C functions?  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-general
Hi,

I seem to be having trouble recreating C functions, the source:

=== test.c ====
#include <postgres.h>
#include <fmgr.h>

PG_MODULE_MAGIC;

int32 plpgsql_test(text* s) {
    return 100;
}
=== end ===

Then compile:
$ cc -fpic -c -I/usr/include/pgsql/server test.c
$ ld -shared -o funcs.so test.o

Then create the function:
CREATE FUNCTION plpgsql_test(text) RETURNS integer
     AS '/storage/Scripts/plpgsql/funcs', 'plpgsql_test'
     LANGUAGE C STRICT IMMUTABLE;

So far it works:
> select plpgsql_test('abc');
100

The problem is if I change test.c like:
return 200;

Then recompile, drop and create the function it still returns 100? However if I compile it as funcs2.so it will then
createthe function with the correct 200 result ... what am I doing wrong? 

Thanks,
Elliot


В списке pgsql-general по дате отправления:

Предыдущее
От: Filip Rembiałkowski
Дата:
Сообщение: Re: crosstab function
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: Recreate C functions?