|
1 | 1 |
|
2 | 2 | Developer's Frequently Asked Questions (FAQ) for PostgreSQL
|
3 | 3 |
|
4 |
| - Last updated:Mon Feb 22 17:15:06 EST 1999 |
| 4 | + Last updated:Sat Jul 10 00:38:09 EDT 1999 |
5 | 5 |
|
6 | 6 | Current maintainer: Bruce Momjian (maillist@candle.pha.pa.us)
|
7 | 7 |
|
8 | 8 | The most recent version of this document can be viewed at the
|
9 |
| - postgreSQL Web site, http://postgreSQL.org. |
| 9 | + postgreSQL Web site, http://PostgreSQL.org. |
10 | 10 | _________________________________________________________________
|
11 | 11 |
|
12 | 12 | Questions
|
|
24 | 24 | 9) How do I efficiently access information in tables from the backend
|
25 | 25 | code?
|
26 | 26 | 10) What is elog()?
|
| 27 | + 11) What is configure all about? |
| 28 | + 12) How do I add a new port? |
27 | 29 | _________________________________________________________________
|
28 | 30 |
|
29 | 31 | 1) What tools are available for developers?
|
|
294 | 296 | While scans automatically lock/unlock rows from the buffer cache, with
|
295 | 297 | heap_fetch(), you must pass a Buffer pointer, and ReleaseBuffer() it
|
296 | 298 | when completed. Once you have the row, you can get data that is common
|
297 |
| - to all tuples, like t_self and t_oid, bymererly accessing the |
| 299 | + to all tuples, like t_self and t_oid, bymerely accessing the |
298 | 300 | HeapTuple structure entries. If you need a table-specific column, you
|
299 | 301 | should take the HeapTuple pointer, and use the GETSTRUCT() macro to
|
300 | 302 | access the table-specific start of the tuple. You then cast the
|
|
324 | 326 | current query, never returning from the call. FATAL terminates the
|
325 | 327 | backend process. The remaining parameters of elog are a printf-style
|
326 | 328 | set of parameters to print.
|
| 329 | + |
| 330 | + 11) What is configure all about? |
| 331 | + |
| 332 | + The files configure and configure.in are part of the GNU autoconf |
| 333 | + package. Configure allows us to test for various capabilities of the |
| 334 | + OS, and to set variables that can then be tested in C programs and |
| 335 | + Makefiles. Autoconf is installed on the PostgreSQL main server. To add |
| 336 | + options to configure, edit configure.in, and then run autoconf to |
| 337 | + generate configure. |
| 338 | + |
| 339 | + When configure is run by the user, it tests various OS capabilities, |
| 340 | + stores those in config.status and config.cache, and modifies a list of |
| 341 | + *.in files. For example, if there exists a Makefile.in, configure |
| 342 | + generates a Makefile that contains substitutions for all @var@ |
| 343 | + parameters found by configure. |
| 344 | + |
| 345 | + When you need to edit files, make sure you don't waste time modifying |
| 346 | + files generated by configure. Edit the *.in file, and re-run configure |
| 347 | + to recreate the needed file. If you run make distclean from the |
| 348 | + top-level source directory, all files derived by configure are |
| 349 | + removed, so you see only the file contained in the source |
| 350 | + distribution. |
| 351 | + |
| 352 | + 12) How do I add a new port? |
| 353 | + |
| 354 | + There are a variety of places that need to be modified to add a new |
| 355 | + port. First, start in the src/template directory. Add an appropriate |
| 356 | + entry for your OS. Also, use src/config.guess to add your OS to |
| 357 | + src/template/.similar. You shouldn't match the OS version exactly. The |
| 358 | + configure test will look for an exact OS version number, and if not |
| 359 | + found, find a match without version number. Edit src/configure.in to |
| 360 | + add your new OS. (See configure item above.) You will need to run |
| 361 | + autoconf, or patch src/configure too. |
| 362 | + |
| 363 | + Then, check src/include/port and add your new OS file, with |
| 364 | + appropriate values. Hopefully, there is already locking code in |
| 365 | + src/include/storage/s_lock.h for your CPU. There is a backend/port |
| 366 | + directory if you need special files for your OS. |