On Tue, Sep 23, 2014 at 7:02 PM, Michael Paquier
<michael.paqu...@gmail.com> wrote:
> On Wed, Sep 24, 2014 at 8:29 AM, Mingzhe Li <mingzhe0...@gmail.com> wrote:
>> Hi experts,
>>
>> 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.
>
> In your question, it seems that you are looking for the main() call
> for the binary postgres, which is located in src/backend/main/main.c.
> At the bottom of main() you'll see as well a set of functions like
> PostmasterMain or PostgresMain that really define the startup path
> used. PostmasterMain for example starts the postmaster, that is then
> able to itself start backend process through PostgresMain()...

As noted main is in main.c.  Most of the interesting stuff that
happens in the main execution loop for the backend is in
tcop/postgres.c (tcop being shorthand for 'traffic cop' -- probably
not a great name but it hails from the very early days of the
project).  That kinda answers your other question: these function
names rarely change except as needed to meet new requirements.

merlin


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to