Обсуждение: new AM, catalog entries

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

new AM, catalog entries

От
Yves Weißig
Дата:
Hi list,

I really have problems with the catalog entries for my AM.
In the doc
(http://developer.postgresql.org/pgdocs/postgres/index-catalog.html) it
says "anyone able to write a new access method is expected to be
competent to insert an appropriate row for themselves." :-) This is true
so far for me as I know how to insert a new row in pg_am, but I don't
know how to fill in the entries in pg_proc. When I try to register my AM
methods
(http://developer.postgresql.org/pgdocs/postgres/index-functions.html) with:
CREATE FUNCTION ebibuild(internal, internal, internal)  RETURNS internal  AS 'ebibuild'  LANGUAGE internal  STRICT;
I keep getting: ERROR:  there is no built-in function named "ebibuild"
This error message somehow leads me to fmgr.c where the contents of an
array are inspected (in line 134). This array fmgr_builtins is built by
fmgr_builtins "Gen_fmgrtab.pl" from pg_proc.h (when? during make?) Do I
have to edit pg_proc.h manually to add my methods for the new AM? I am a
little bit to highly confused.

Greetz, Yves


Re: new AM, catalog entries

От
Alvaro Herrera
Дата:
Excerpts from Yves Weißig's message of mar abr 26 11:32:31 -0300 2011:

> I keep getting: ERROR:  there is no built-in function named "ebibuild"
> This error message somehow leads me to fmgr.c where the contents of an
> array are inspected (in line 134). This array fmgr_builtins is built by
> fmgr_builtins "Gen_fmgrtab.pl" from pg_proc.h (when? during make?)

Yes, during make.

> Do I have to edit pg_proc.h manually to add my methods for the new AM?

Yes.  Or maybe you can try using language C instead of internal (if you
have it in a shared library).

-- 
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


Re: new AM, catalog entries

От
Yves Weißig
Дата:
Am 26.04.2011 17:07, schrieb Alvaro Herrera:
> Excerpts from Yves Weißig's message of mar abr 26 11:32:31 -0300 2011:
> 
>> I keep getting: ERROR:  there is no built-in function named "ebibuild"
>> This error message somehow leads me to fmgr.c where the contents of an
>> array are inspected (in line 134). This array fmgr_builtins is built by
>> fmgr_builtins "Gen_fmgrtab.pl" from pg_proc.h (when? during make?)
> 
> Yes, during make.
> 
>> Do I have to edit pg_proc.h manually to add my methods for the new AM?
> 
> Yes.  Or maybe you can try using language C instead of internal (if you
> have it in a shared library).
> 

Thanks for the answer and a little bit more insight into pg!

Yves