11
22 Developer's Frequently Asked Questions (FAQ) for PostgreSQL
33
4- Last updated:Mon Mar 19 12:52:30 EDT 2007
4+ Last updated:Sat May 5 00:09:15 EDT 2007
55
66 Current maintainer: Bruce Momjian (bruce@momjian.us)
77
@@ -15,22 +15,23 @@ General Questions
1515 1.2) What development environment is required to develop code?
1616 1.3) What areas need work?
1717 1.4) What do I do after choosing an item to work on?
18- 1.5) I've developed a patch, what next?
19- 1.6) Where can I learn more about the code?
20- 1.7) How do I download/update the current source tree?
21- 1.8) How do I test my changes?
22- 1.9) What tools are available for developers?
23- 1.10) What books are good for developers?
24- 1.11) What is configure all about?
25- 1.12) How do I add a new port?
26- 1.13) Why don't you use threads, raw devices, async-I/O, <insert your
18+ 1.5) I have developed a patch, what next?
19+ 1.6) How is a patch reviewed?
20+ 1.7) Where can I learn more about the code?
21+ 1.8) How do I download/update the current source tree?
22+ 1.9) How do I test my changes?
23+ 1.10) What tools are available for developers?
24+ 1.11) What books are good for developers?
25+ 1.12) What is configure all about?
26+ 1.13) How do I add a new port?
27+ 1.14) Why don't you use threads, raw devices, async-I/O, <insert your
2728 favorite wizz-bang feature here>?
28- 1.14 ) How are RPM's packaged?
29- 1.15 ) How are CVS branches handled?
30- 1.16 ) Where can I get a copy of the SQL standards?
31- 1.17 ) Where can I get technical assistance?
32- 1.18 ) How do I get involved in PostgreSQL web site development?
33- 1.19 ) Why haven't you replaced CVS with SVN, Git, Monotone, VSS,
29+ 1.15 ) How are RPM's packaged?
30+ 1.16 ) How are CVS branches handled?
31+ 1.17 ) Where can I get a copy of the SQL standards?
32+ 1.18 ) Where can I get technical assistance?
33+ 1.19 ) How do I get involved in PostgreSQL web site development?
34+ 1.20 ) Why haven't you replaced CVS with SVN, Git, Monotone, VSS,
3435 <insert your favorite SCM system here>?
3536
3637Technical Questions
@@ -51,7 +52,7 @@ General Questions
5152
5253 1.1) How do I get involved in PostgreSQL development?
5354
54- Download the code and have a look around. See 1.7 .
55+ Download the code and have a look around. See 1.8 .
5556
5657 Subscribe to and read the pgsql-hackers mailing list (often termed
5758 'hackers'). This is where the major contributors and core members of
@@ -93,7 +94,7 @@ General Questions
9394 http://www.postgresql.org/docs/faqs.TODO.html.
9495
9596 You can learn more about these features by consulting the archives,
96- the SQL standards and the recommend texts (see 1.10 ).
97+ the SQL standards and the recommend texts (see 1.11 ).
9798
9899 1.4) What do I do after choosing an item to work on?
99100
@@ -113,7 +114,7 @@ General Questions
113114 being kept for the next release,
114115 http://momjian.postgresql.org/cgi-bin/pgpatches_hold.
115116
116- 1.5) I've developed a patch, what next?
117+ 1.5) I have developed a patch, what next?
117118
118119 You will need to submit the patch to pgsql-patches@postgresql.org. It
119120 will be reviewed by other contributors to the project and will be
@@ -122,7 +123,7 @@ General Questions
122123 make sure your submission conforms to the following guidelines:
123124 1. Ensure that your patch is generated against the most recent
124125 version of the code, which for developers is CVS HEAD. For more on
125- branches in PostgreSQL, see 1.15 .
126+ branches in PostgreSQL, see 1.16 .
126127 2. Try to make your patch as readable as possible by following the
127128 project's code-layout conventions. This makes it easier for the
128129 reviewer, and there's no point in trying to layout things
@@ -145,7 +146,7 @@ General Questions
145146 6. If you are adding a new feature, confirm that it has been tested
146147 thoroughly. Try to test the feature in all conceivable scenarios.
147148 7. New feature patches should also be accompanied by documentation
148- patches. If you need help checking the SQL standard, see 1.16 .
149+ patches. If you need help checking the SQL standard, see 1.17 .
149150 8. Provide an implementation overview, preferably in code comments.
150151 Following the surrounding code commenting style is usually a good
151152 approach.
@@ -162,14 +163,32 @@ General Questions
162163 You will be notified via email when the patch is applied, and your
163164 name will appear in the next version of the release notes.
164165
165- 1.6) Where can I learn more about the code?
166+ 1.6) How is a patch reviewed?
167+
168+ Patch committers check several things before applying a patch:
169+ * Patch follows the SQL standard or community agreed-upon behavior
170+ * Style merges seamlessly into the surrounding code
171+ * Written as simply and efficiently as possible
172+ * Uses the available PostgreSQL subsystems properly
173+ * Contains sufficient comments
174+ * Contains code that works on all supported operating systems
175+ * Has proper documentation
176+ * Passes all regression tests
177+ * Behaves as expected, even under unusual cirumstances
178+ * Contains no reliability risks
179+ * Does not overly complicate the source code
180+ * If performance-related, has a measureable performance benefit
181+ * Is of sufficient usefulness to the average PostgreSQL user
182+ * Follows existing PostgreSQL coding standards
183+
184+ 1.7) Where can I learn more about the code?
166185
167186 Other than documentation in the source tree itself, you can find some
168187 papers/presentations discussing the code at
169188 http://www.postgresql.org/developer. An excellent presentation is at
170189 http://neilconway.org/talks/hacking/
171190
172- 1.7 ) How do I download/update the current source tree?
191+ 1.8 ) How do I download/update the current source tree?
173192
174193 There are several ways to obtain the source tree. Occasional
175194 developers can just get the most recent source tree snapshot from
@@ -180,7 +199,7 @@ General Questions
180199 in CVS. For details of how to obtain the source from CVS see
181200 http://developer.postgresql.org/docs/postgres/cvs.html.
182201
183- 1.8 ) How do I test my changes?
202+ 1.9 ) How do I test my changes?
184203
185204 Basic system testing
186205
@@ -223,7 +242,7 @@ General Questions
223242 you are using GCC you can use the --enable-depend option of configure
224243 to have the compiler compute the dependencies automatically.
225244
226- 1.9 ) What tools are available for developers?
245+ 1.10 ) What tools are available for developers?
227246
228247 First, all the files in the src/tools directory are designed for
229248 developers.
@@ -316,7 +335,7 @@ General Questions
316335 is also a script called unused_oids in pgsql/src/include/catalog that
317336 shows the unused oids.
318337
319- 1.10 ) What books are good for developers?
338+ 1.11 ) What books are good for developers?
320339
321340 I have four good books, An Introduction to Database Systems, by C.J.
322341 Date, Addison, Wesley, A Guide to the SQL Standard, by C.J. Date, et.
@@ -326,7 +345,7 @@ General Questions
326345 There is also a database performance site, with a handbook on-line
327346 written by Jim Gray at http://www.benchmarkresources.com..
328347
329- 1.11 ) What is configure all about?
348+ 1.12 ) What is configure all about?
330349
331350 The files configure and configure.in are part of the GNU autoconf
332351 package. Configure allows us to test for various capabilities of the
@@ -348,7 +367,7 @@ General Questions
348367 removed, so you see only the file contained in the source
349368 distribution.
350369
351- 1.12 ) How do I add a new port?
370+ 1.13 ) How do I add a new port?
352371
353372 There are a variety of places that need to be modified to add a new
354373 port. First, start in the src/template directory. Add an appropriate
@@ -365,7 +384,7 @@ General Questions
365384 src/makefiles directory for port-specific Makefile handling. There is
366385 a backend/port directory if you need special files for your OS.
367386
368- 1.13 ) Why don't you use threads, raw devices, async-I/O, <insert your
387+ 1.14 ) Why don't you use threads, raw devices, async-I/O, <insert your
369388 favorite wizz-bang feature here>?
370389
371390 There is always a temptation to use the newest operating system
@@ -391,7 +410,7 @@ General Questions
391410 cautious about their adoption. The TODO list often contains links to
392411 discussions showing our reasoning in these areas.
393412
394- 1.14 ) How are RPMs packaged?
413+ 1.15 ) How are RPMs packaged?
395414
396415 This was written by Lamar Owen and Devrim Gündüz:
397416
@@ -472,7 +491,7 @@ General Questions
472491 As to why all these files aren't part of the source tree, well, unless
473492 there was a large cry for it to happen, we don't believe it should.
474493
475- 1.15 ) How are CVS branches managed?
494+ 1.16 ) How are CVS branches managed?
476495
477496 This was written by Tom Lane:
478497
@@ -531,7 +550,7 @@ General Questions
531550 tree right away after a major release --- we wait for a dot-release or
532551 two, so that we won't have to double-patch the first wave of fixes.
533552
534- 1.16 ) Where can I get a copy of the SQL standards?
553+ 1.17 ) Where can I get a copy of the SQL standards?
535554
536555 There are three versions of the SQL standard: SQL-92, SQL:1999, and
537556 SQL:2003. They are endorsed by ANSI and ISO. Draft versions can be
@@ -548,7 +567,7 @@ General Questions
548567 * http://www.contrib.andrew.cmu.edu/~shadow/sql.html#syntax (SQL-92)
549568 * http://dbs.uni-leipzig.de/en/lokal/standards.pdf (paper)
550569
551- 1.17 ) Where can I get technical assistance?
570+ 1.18 ) Where can I get technical assistance?
552571
553572 Many technical questions held by those new to the code have been
554573 answered on the pgsql-hackers mailing list - the archives of which can
@@ -561,15 +580,15 @@ General Questions
561580 questions about development of new features, on IRC at
562581 irc.freenode.net in the #postgresql channel.
563582
564- 1.18 ) How do I get involved in PostgreSQL web site development?
583+ 1.19 ) How do I get involved in PostgreSQL web site development?
565584
566585 PostgreSQL website development is discussed on the
567586 pgsql-www@postgresql.org mailing list. The is a project page where the
568587 source code is available at
569588 http://gborg.postgresql.org/project/pgweb/projdisplay.php , the code
570589 for the next version of the website is under the "portal" module.
571590
572- 1.19 ) Why haven't you replaced CVS with SVN, Git, Monotone, VSS, <insert your
591+ 1.20 ) Why haven't you replaced CVS with SVN, Git, Monotone, VSS, <insert your
573592 favorite SCMS here>?
574593
575594 Currently the core developers see no SCMS that will provide enough
@@ -745,7 +764,7 @@ typedef struct nameData
745764 those structures (in particular, the files copyfuncs.c and
746765 equalfuncs.c. Make sure you add support for your new field to these
747766 files. Find any other places the structure might need code for your
748- new field. mkid is helpful with this (see 1.9 ).
767+ new field. mkid is helpful with this (see 1.10 ).
749768
750769 2.5) Why do we use palloc() and pfree() to allocate memory?
751770