Re: "Core" function in Postgres

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: "Core" function in Postgres
Дата
Msg-id CAHyXU0yjEGjeDMPiZm1K6igzAgeMt3R-rvpcW3wgMtOhZDXv3w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: "Core" function in Postgres  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-hackers
On Tue, Sep 23, 2014 at 7:02 PM, Michael Paquier
<michael.paquier@gmail.com> wrote:
> On Wed, Sep 24, 2014 at 8:29 AM, Mingzhe Li <mingzhe0908@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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: make pg_controldata accept "-D dirname"
Следующее
От: Robert Haas
Дата:
Сообщение: Re: identify_locking_dependencies is broken for schema-only dumps