Rob Richardson wrote:
> AI Rumman wrote:
>> Now, its time to learn the internals of Postgresql system. I
>> downloaded the source code and imported it in my eclipse
>> environment. But I have very limited knowledge on C programming.
>> Could you guys please guide me from where I should start?
> I think maybe the best question to ask in response to yours is:
> why? Is there something you think should be improved? Is there some
> question you have about how it works or how it should be used or
> why you are getting some result instead of the result you're
> expecting? Do you want to use the source code as a sample to help
> you learn C?
>
> If you could tell us your goal, we would be better able to help you
> get there.
+1
> P.S. I've been a C/C++/C# programmer for well over 20 years, and I
> doubt that I could understand the PostgreSQL source code.
You might be surprised. When I approached the source code to work on
a feature, the sheer volume of it was intimidating, with over a
million lines in .c and .h files; but the organization, quality, and
documentation of the code is undoubtedly the best I've ever seen,
making it surprisingly approachable.
The key, I think, is *focus*. There is too much there to just browse
it all and take it all in; you must have a reason to go in and idea
of what you're going to do so you can find the relevant part of the
code. Part of "good organization" is having a number of subsystems
which can be treated as "black boxes" when you're looking at the code
of interest -- you don't need to understand the internals of adjacent
subsystems, just the APIs. (Of course, like all software
abstractions, practical considerations can compromise that to some
degree when you get down to nitty-gritty details in implementing
something, but the abstractions help a lot when trying to understand
any particular area.)
-Kevin