Re: new AM, catalog entries

Lists: pgsql-hackers
From: Yves Weißig <weissig(at)rbg(dot)informatik(dot)tu-darmstadt(dot)de>
To: pgsql-hackers(at)postgresql(dot)org
Subject: new AM, catalog entries
Date: 2011-04-26 14:32:31
Message-ID: 4DB6D77F.7070802@rbg.informatik.tu-darmstadt.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: weissig <weissig(at)rbg(dot)informatik(dot)tu-darmstadt(dot)de>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: new AM, catalog entries
Date: 2011-04-26 15:07:18
Message-ID: 1303830342-sup-5272@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


From: Yves Weißig <weissig(at)rbg(dot)informatik(dot)tu-darmstadt(dot)de>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: new AM, catalog entries
Date: 2011-04-27 14:04:14
Message-ID: 4DB8225E.60209@rbg.informatik.tu-darmstadt.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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