Re: [HACKERS] “Core” function in Postgres - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: [HACKERS] “Core” function in Postgres
Date
Msg-id CAM3SWZR+yrugdC18Jix26x_JKUYdnLZgJimBtgAt56XdgMUFrg@mail.gmail.com
Whole thread Raw
In response to “Core” function in Postgres  (Mingzhe Li <mingzhe0908@gmail.com>)
List pgsql-hackers
On Tue, Sep 23, 2014 at 4:29 PM, Mingzhe Li <mingzhe0908@gmail.com> wrote:
> I want to know what's the "core" function used in Postgres server? I am
> looking for something corresponding to main() in a simple C program. I want
> to know the file path and the function name. I am using Postgres 9.3.5,
> however I assume the "core" function will be unchanged between different
> revisions.
>
> Please let me know if you are confused by my question.

I think that the tcop is the closest thing to what you're looking for
(which includes postgres.c/PostgresMain()). There is a very simple
stub entry point ("main(int argc, char *argv[])") within main.c, too,
which is the real entry point.

Why not just set some breakpoints in a place that seems interesting
from within GDB, and inspect the call stack? That can be a useful
technique for gaining understanding of the structure of complicated
codebases that you're totally unfamiliar with.

--
Peter Geoghegan



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Scaling shared buffer eviction
Next
From: Michael Paquier
Date:
Subject: Re: "Core" function in Postgres