Re: PG function call

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: smile khmer <khmersmile(at)email(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: PG function call
Date: 2005-10-06 14:30:37
Message-ID: 20051006143037.GA7044@surnet.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 06, 2005 at 09:06:59AM -0500, smile khmer wrote:
> Dear all,
>
> Does anyone know how index searching work in PG. I've explored the
> source code of PG, for btree, for searching, it will call the
> functions in file btcompare.c. As I've made a printf in the functions
> of the file btcompare.c. When I compile and run PG, it get into
> loop,..... the messages are printed and printed .....

Not a loop -- the function may just be called a lot of times.

> I want to know how the function called happen in Postgres,
> it seems that it doesn't call the function directly !

The code gets function pointers through the catalogs, so they will be
called even if you don't see a direct function call. At some time the
code will ask for the equality function for such-and-such datatype, then
call it.

--
Alvaro Herrera http://www.amazon.com/gp/registry/CTMLCN8V17R4
"Acepta los honores y aplausos y perderás tu libertad"

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message sandeep satpal 2005-10-06 14:39:50 How PG_FUNCTION_ARG works in PG
Previous Message Tom Lane 2005-10-06 14:30:24 Re: fixing LISTEN/NOTIFY