From 2a69a0e14797d3ffccdf7ffc83fe07702209e414 Mon Sep 17 00:00:00 2001
From: Bruce Momjian Last updated: Tue Nov 22 10:12:24 EST 2005 Last updated: Tue Nov 22 10:16:48 EST 2005 Current maintainer: Bruce Momjian (pgman@candle.pha.pa.us)
@@ -26,97 +26,97 @@
PostgreSQL is pronounced Post-Gres-Q-L, and is also sometimes
referred to as just Postgres. An audio file is available in
@@ -145,7 +145,7 @@
http://www.postgresql.org/files/documentation/faqs/FAQ_DEV.html
If you are looking for a PostgreSQL gatekeeper, central committee,
or controlling company, give up --- there isn't one. We do have a
@@ -157,7 +157,7 @@
Developer's FAQ for information on how to get involved in PostgreSQL
development.) PostgreSQL is distributed under the classic BSD license. Basically,
@@ -191,7 +191,7 @@
UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE,
SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. In general, any modern Unix-compatible platform should be able to
run PostgreSQL. The platforms that had received explicit testing at
@@ -210,21 +210,21 @@
"http://hobbes.nmsu.edu/cgi-bin/h-search?sh=1&button=Search&key=postgreSQL&stype=all&sort=type&dir=%2F">
http://hobbes.nmsu.edu/cgi-bin/h-search?sh=1&button=Search&key=postgreSQL&stype=all&sort=type&dir=%2F. Via web browser, use
http://www.postgresql.org/ftp/, and via ftp, use
ftp://ftp.PostgreSQL.org/pub/. The latest release of PostgreSQL is version 8.1.1 We plan to have a major release every year, with minor releases
every few months. The PostgreSQL community provides assistance to many of its users
via email. The main web site to subscribe to the email lists is
@@ -243,7 +243,7 @@
"http://techdocs.postgresql.org/companies.php">
http://techdocs.postgresql.org/companies.php. Visit the PostgreSQL bug form at
@@ -280,7 +280,7 @@
- PostgreSQL supports an extended subset of SQL:2003.
@@ -312,7 +312,7 @@
Even the release notes do not contain every change made to the
software. PostgreSQL includes extensive documentation, including a large
manual, manual pages, and some test examples. See the /doc
@@ -338,7 +338,7 @@
Our web site contains even more documentation. First, consider the PostgreSQL-specific books mentioned above.
@@ -357,13 +357,13 @@
and at http://sqlcourse.com. See the
Developer's FAQ. There are several ways of measuring software: features,
@@ -410,7 +410,7 @@
community, manuals, and the source code often make PostgreSQL
support superior to other DBMSs. There is
commercial per-incident support available for those who need it.
- (See FAQ section 1.7.) The PostgreSQL install includes only the C and embedded
@@ -442,7 +442,7 @@
in the Drivers/Interfaces section and via Internet search.
A nice introduction to Database-backed Web pages can be seen at:
@@ -455,7 +455,7 @@
For complex cases, many use the Perl and DBD::Pg with CGI.pm or
mod_perl. Changing the data type of a column can be done easily in 8.0
and later with ALTER TABLE ALTER COLUMN TYPE. You might then want to do VACUUM FULL tab to reclaim the
disk space used by the expired rows. These are the limits:Frequently Asked Questions (FAQ) for PostgreSQL
-
General Questions
- 1.1) What is PostgreSQL? How is it pronounced?
- 1.2) Who controls PostgreSQL?
- 1.3) What is the copyright of PostgreSQL?
- 1.4) What platforms does PostgreSQL support?
- 1.5) Where can I get PostgreSQL?
- 1.6) What is the latest release?
- 1.7) Where can I get support?
- 1.8) How do I submit a bug report?
- 1.9) How do I find out about known bugs or
+ 1.1) What is PostgreSQL? How is it pronounced?
+ 1.2) Who controls PostgreSQL?
+ 1.3) What is the copyright of PostgreSQL?
+ 1.4) What platforms does PostgreSQL support?
+ 1.5) Where can I get PostgreSQL?
+ 1.6) What is the latest release?
+ 1.7) Where can I get support?
+ 1.8) How do I submit a bug report?
+ 1.9) How do I find out about known bugs or
missing features?
- 1.10) What documentation is available?
- 1.11) How can I learn SQL?
- 1.12) How do I join the development team?
- 1.13) How does PostgreSQL compare to other
+ 1.10) What documentation is available?
+ 1.11) How can I learn SQL?
+ 1.12) How do I join the development team?
+ 1.13) How does PostgreSQL compare to other
DBMSs?
User Client Questions
- 2.1) What interfaces are available for
+ 2.1) What interfaces are available for
PostgreSQL?
- 2.2) What tools are available for using
+ 2.2) What tools are available for using
PostgreSQL with Web pages?
- 2.3) Does PostgreSQL have a graphical user
+ 2.3) Does PostgreSQL have a graphical user
interface?
Administrative Questions
- 3.1) How do I install PostgreSQL somewhere other
+ 3.1) How do I install PostgreSQL somewhere other
than /usr/local/pgsql?
- 3.2) How do I control connections from other
+ 3.2) How do I control connections from other
hosts?
- 3.3) How do I tune the database engine for
+ 3.3) How do I tune the database engine for
better performance?
- 3.4) What debugging features are available?
- 3.5) Why do I get "Sorry, too many
+ 3.4) What debugging features are available?
+ 3.5) Why do I get "Sorry, too many
clients" when trying to connect?
- 3.6) Why do I need to do a dump and restore
+ 3.6) Why do I need to do a dump and restore
to upgrade PostgreSQL releases?
- 3.7) What computer hardware should I use?
+ 3.7) What computer hardware should I use?
Operational Questions
- 4.1) How do I SELECT only the
+ 4.1) How do I SELECT only the
first few rows of a query? A random row?
- 4.2) How do I find out what tables, indexes,
+ 4.2) How do I find out what tables, indexes,
databases, and users are defined? How do I see the queries used
by psql to display them?
- 4.3) How do you change a column's data type?
- 4.4) What is the maximum size for a row, a
+ 4.3) How do you change a column's data type?
+ 4.4) What is the maximum size for a row, a
table, and a database?
- 4.5) How much database disk space is required
+ 4.5) How much database disk space is required
to store data from a typical text file?
- 4.6) Why are my queries slow? Why don't they
+ 4.6) Why are my queries slow? Why don't they
use my indexes?
- 4.7) How do I see how the query optimizer is
+ 4.7) How do I see how the query optimizer is
evaluating my query?
- 4.8) How do I perform regular expression
+ 4.8) How do I perform regular expression
searches and case-insensitive regular expression searches? How do I
use an index for case-insensitive searches?
- 4.9) In a query, how do I detect if a field
+ 4.9) In a query, how do I detect if a field
is NULL? How can I sort on whether a field is
NULL or not?
- 4.10) What is the difference between the
+ 4.10) What is the difference between the
various character types?
- 4.11.1) How do I create a
+ 4.11.1) How do I create a
serial/auto-incrementing field?
- 4.11.2) How do I get the value of a
+ 4.11.2) How do I get the value of a
SERIAL insert?
- 4.11.3) Doesn't currval()
+ 4.11.3) Doesn't currval()
lead to a race condition with other users?
- 4.11.4) Why aren't my sequence numbers
+ 4.11.4) Why aren't my sequence numbers
reused on transaction abort? Why are there gaps in the numbering of
my sequence/SERIAL column?
- 4.12) What is an OID? What is a
+ 4.12) What is an OID? What is a
CTID?
- 4.13) Why do I get the error "ERROR: Memory
+ 4.13) Why do I get the error "ERROR: Memory
exhausted in AllocSetAlloc()"?
- 4.14) How do I tell what PostgreSQL version I
+ 4.14) How do I tell what PostgreSQL version I
am running?
- 4.15) How do I create a column that will
+ 4.15) How do I create a column that will
default to the current time?
- 4.16) How do I perform an outer join?
- 4.17) How do I perform queries using multiple
+ 4.16) How do I perform an outer join?
+ 4.17) How do I perform queries using multiple
databases?
- 4.18) How do I return multiple rows or columns
+ 4.18) How do I return multiple rows or columns
from a function?
- 4.19) Why do I get "relation with OID #####
+ 4.19) Why do I get "relation with OID #####
does not exist" errors when accessing temporary tables in PL/PgSQL
functions?
- 4.20) What replication solutions are available?
- 4.21) Why are my table and column names not
+ 4.20) What replication solutions are available?
+ 4.21) Why are my table and column names not
recognized in my query?
@@ -124,7 +124,7 @@
General Questions
- 1.1) What is PostgreSQL? How is it pronounced?
+ 1.1) What is PostgreSQL? How is it pronounced?
1.2) Who controls PostgreSQL?
+ 1.2) Who controls PostgreSQL?
1.3) What is the copyright of
+
1.3) What is the copyright of
PostgreSQL?
1.4) What platforms does PostgreSQL support?
+ 1.4) What platforms does PostgreSQL support?
1.5) Where can I get PostgreSQL?
+ 1.5) Where can I get PostgreSQL?
1.6) What is the latest release?
+ 1.6) What is the latest release?
1.7) Where can I get support?
+ 1.7) Where can I get support?
1.8) How do I submit a bug report?
+ 1.8) How do I submit a bug report?
1.9) How do I find out about known bugs or
+
1.9) How do I find out about known bugs or
missing features?
1.10) What documentation is available?
+ 1.10) What documentation is available?
1.11) How can I learn
+
1.11) How can I learn
SQL?
1.12) How do I join the development
+
1.12) How do I join the development
team?
1.13) How does PostgreSQL compare to other
+
1.13) How does PostgreSQL compare to other
DBMSs?
+ (See FAQ section 1.7.)
@@ -427,7 +427,7 @@
User Client Questions
- 2.1) What interfaces are available for
+
2.1) What interfaces are available for
PostgreSQL?
2.2) What tools are available for using
+
2.2) What tools are available for using
PostgreSQL with Web pages?
2.3) Does PostgreSQL have a graphical user
+
- 2.3) Does PostgreSQL have a graphical user
interface?
4.3) How do you change a column's data type?
+ 4.3) How do you change a column's data type?
4.4) What is the maximum size for a row, a
+
4.4) What is the maximum size for a row, a
table, and a database?
unlimited
of an MD5 hash of the long column, and full text indexing
allows for searching of words within the column.
A PostgreSQL database may require up to five times the disk @@ -713,7 +713,7 @@ table?
NULLs are stored as bitmaps, so they use very little space.
-Indexes are not used by every query. Indexes are used only if the @@ -764,7 +764,7 @@ table?
See the EXPLAIN manual page.
-@@ -869,7 +869,7 @@ length particularly values that include NULL bytes. All the types described here have similar performance characteristics. -
4.11.1) How do I create a +
4.11.1) How do I create a serial/auto-incrementing field?
PostgreSQL supports a SERIAL data type. It @@ -894,13 +894,13 @@ length See the create_sequence manual page for more information about sequences. -
4.11.2) How do I get the value of a +
4.11.2) How do I get the value of a SERIAL insert?
One approach is to retrieve the next SERIAL value from the sequence object with the nextval() function before inserting and then insert it explicitly. Using the - example table in 4.11.1, an example in a + example table in 4.11.1, an example in a pseudo-language would look like this:
new_id = execute("SELECT nextval('person_id_seq')"); @@ -923,13 +923,13 @@ length new_id = execute("SELECT currval('person_id_seq')");-4.11.3) Doesn't currval() +
4.11.3) Doesn't currval() lead to a race condition with other users?
No. currval() returns the current value assigned by your session, not by all sessions.
-4.11.4) Why aren't my sequence numbers +
4.11.4) Why aren't my sequence numbers reused on transaction abort? Why are there gaps in the numbering of my sequence/SERIAL column?
@@ -938,7 +938,7 @@ length completes. This causes gaps in numbering from aborted transactions. -4.12) What is an OID? What is +
4.12) What is an OID? What is a CTID?
Every row that is created in PostgreSQL gets a unique @@ -961,7 +961,7 @@ length are modified or reloaded. They are used by index entries to point to physical rows.
-4.13) Why do I get the error "ERROR: +
4.13) Why do I get the error "ERROR: Memory exhausted in AllocSetAlloc()"?
You probably have run out of virtual memory on your system, @@ -980,12 +980,12 @@ length backend is returning too much data, try it before starting the client. -
4.14) How do I tell what PostgreSQL version +
4.14) How do I tell what PostgreSQL version I am running?
From psql, type
-SELECT version();
4.15) How do I create a column that will +
4.15) How do I create a column that will default to the current time?
Use CURRENT_TIMESTAMP:
@@ -993,7 +993,7 @@ length CREATE TABLE test (x int, modtime TIMESTAMP DEFAULT CURRENT_TIMESTAMP ); -4.16) How do I perform an outer join?
+4.16) How do I perform an outer join?
PostgreSQL supports outer joins using the SQL standard syntax. Here are two examples:
@@ -1016,7 +1016,7 @@ length RIGHT, and FULL joins. Ordinary joins are called INNER joins. -4.17) How do I perform queries using +
4.17) How do I perform queries using multiple databases?
There is no way to query a database other than the current one. @@ -1028,14 +1028,14 @@ length connections to different databases and merge the results on the client side.
-4.18) How do I return multiple rows or +
4.18) How do I return multiple rows or columns from a function?
It is easy using set-returning functions, http://techdocs.postgresql.org/guides/SetReturningFunctions
. -4.19) Why do I get "relation with OID ##### +
4.19) Why do I get "relation with OID ##### does not exist" errors when accessing temporary tables in PL/PgSQL functions?
@@ -1047,7 +1047,7 @@ length EXECUTE for temporary table access in PL/PgSQL. This will cause the query to be reparsed every time. -4.20) What replication solutions are available? +
4.20) What replication solutions are available?
Though "replication" is a single term, there are several technologies @@ -1069,7 +1069,7 @@ length
There are also commercial and hardware-based replication solutions available supporting a variety of replication models.
-4.21) Why are my table and column names not +
4.21) Why are my table and column names not recognized in my query?
The most common cause is the use of double-quotes around table or diff --git a/doc/src/FAQ/FAQ_DEV.html b/doc/src/FAQ/FAQ_DEV.html index 81468b10d1..58975c8be0 100644 --- a/doc/src/FAQ/FAQ_DEV.html +++ b/doc/src/FAQ/FAQ_DEV.html @@ -13,7 +13,7 @@
Developer's Frequently Asked Questions (FAQ) for PostgreSQL
-Last updated: Tue Nov 22 10:13:04 EST 2005
+Last updated: Tue Nov 22 10:17:05 EST 2005
Current maintainer: Bruce Momjian (pgman@candle.pha.pa.us)
@@ -27,51 +27,51 @@General Questions
- 1.1) How do I get involved in PostgreSQL + 1.1) How do I get involved in PostgreSQL development?
- 1.2) What development environment is required + 1.2) What development environment is required to develop code?
- 1.3) What areas need work?
- 1.4) What do I do after choosing an item to + 1.3) What areas need work?
+ 1.4) What do I do after choosing an item to work on?
- 1.5) I've developed a patch, what next?
- 1.6) Where can I learn more about the code?
- 1.7) How do I download/update the current + 1.5) I've developed a patch, what next?
+ 1.6) Where can I learn more about the code?
+ 1.7) How do I download/update the current source tree?
- 1.8) How do I test my changes?
- 1.9) What tools are available for + 1.8) How do I test my changes?
+ 1.9) What tools are available for developers?
- 1.10) What books are good for developers?
- 1.11) What is configure all about?
- 1.12) How do I add a new port?
- 1.13) Why don't you use threads, raw + 1.10) What books are good for developers?
+ 1.11) What is configure all about?
+ 1.12) How do I add a new port?
+ 1.13) Why don't you use threads, raw devices, async-I/O, <insert your favorite wizz-bang feature here>?
- 1.14) How are RPM's packaged?
- 1.15) How are CVS branches handled?
- 1.16) Where can I get a copy of the SQL + 1.14) How are RPM's packaged?
+ 1.15) How are CVS branches handled?
+ 1.16) Where can I get a copy of the SQL standards?
- 1.17) Where can I get technical + 1.17) Where can I get technical assistance?
- 1.18) How do I get involved in PostgreSQL web + 1.18) How do I get involved in PostgreSQL web site development?
Technical Questions
- 2.1) How do I efficiently access information in + 2.1) How do I efficiently access information in tables from the backend code?
- 2.2) Why are table, column, type, function, + 2.2) Why are table, column, type, function, view names sometimes referenced as Name or NameData, and sometimes as char *?
- 2.3) Why do we use Node and List + 2.3) Why do we use Node and List to make data structures?
- 2.4) I just added a field to a structure. What + 2.4) I just added a field to a structure. What else should I do?
- 2.5) Why do we use palloc() and + 2.5) Why do we use palloc() and pfree() to allocate memory?
- 2.6) What is ereport()?
- 2.7) What is CommandCounterIncrement()?
- 2.8) What debugging features are available?
+ 2.6) What is ereport()?
+ 2.7) What is CommandCounterIncrement()?
+ 2.8) What debugging features are available?
@@ -79,7 +79,7 @@General Questions
-1.1) How do I get involved in PostgreSQL +
1.1) How do I get involved in PostgreSQL development?
Download the code and have a look around. See -
-1.2) What development environment is required +
1.2) What development environment is required to develop code?
PostgreSQL is developed mostly in the C programming language. It @@ -123,7 +123,7 @@ when you make a modification to a C header file, all files depend upon that file are also rebuilt.
-1.3) What areas need work?
+1.3) What areas need work?
Outstanding features are detailed in the TODO list. This is located in doc/TODO in the source distribution or at @@ -134,7 +134,7 @@ archives, the SQL standards and the recommend texts (see 1.10).1.4) What do I do after choosing an item to +
1.4) What do I do after choosing an item to work on?
Send an email to pgsql-hackers with a proposal for what you want @@ -154,7 +154,7 @@ http://momjian.postgresql.org/cgi-bin/pgpatches2.
-1.5) I've developed a patch, what next?
+1.5) I've developed a patch, what next?
Generate the patch in contextual diff format. If you are unfamiliar with this, you might find the script @@ -174,7 +174,7 @@ that, let us know and we will manually update the documentation when the patch is applied.
-1.6) Where can I learn more about the +
1.6) Where can I learn more about the code?
Other than documentation in the source tree itself, you can find @@ -182,7 +182,7 @@ "http://www.postgresql.org/developer"> http://www.postgresql.org/developer.
-1.7) How do I download/update the current +
1.7) How do I download/update the current source tree?
There are several ways to obtain the source tree. Occasional @@ -197,7 +197,7 @@ "http://developer.postgresql.org/docs/postgres/cvs.html"> http://developer.postgresql.org/docs/postgres/cvs.html.
-1.8) How do I test my changes?
+1.8) How do I test my changes?
Basic system testing
@@ -245,7 +245,7 @@ you can use the --enable-depend option of configure to have the compiler compute the dependencies automatically. -1.9) What tools are available for +
1.9) What tools are available for developers?
First, all the files in the src/tools directory are @@ -380,7 +380,7 @@ There is also a script called unused_oids in pgsql/src/include/catalog that shows the unused oids.
-1.10) What books are good for +
1.10) What books are good for developers?
I have four good books, An Introduction to Database @@ -394,7 +394,7 @@ on-line written by Jim Gray at http://www.benchmarkresources.com..
-1.11) What is configure all about?
+1.11) What is configure all about?
The files configure and configure.in are part of the GNU autoconf package. Configure allows us to test for @@ -418,7 +418,7 @@ all files derived by configure are removed, so you see only the file contained in the source distribution.
-1.12) How do I add a new port?
+1.12) How do I add a new port?
There are a variety of places that need to be modified to add a new port. First, start in the src/template directory. Add an @@ -437,7 +437,7 @@ handling. There is a backend/port directory if you need special files for your OS.
-1.13) Why don't you use threads, raw +
1.13) Why don't you use threads, raw devices, async-I/O, <insert your favorite wizz-bang feature here>?
@@ -471,7 +471,7 @@ cautious about their adoption. The TODO list often contains links to discussions showing our reasoning in these areas. -1.14) How are RPMs packaged?
+1.14) How are RPMs packaged?
This was written by Lamar Owen:
@@ -576,7 +576,7 @@Of course, there are many projects that DO include all the files necessary to build RPMs from their Official Tarball (TM).
-1.15) How are CVS branches managed?
+1.15) How are CVS branches managed?
This was written by Tom Lane:
@@ -646,7 +646,7 @@ dot-release or two, so that we won't have to double-patch the first wave of fixes. -1.16) Where can I get a copy of the SQL +
1.16) Where can I get a copy of the SQL standards?
There are three versions of the SQL standard: SQL-92, SQL:1999, @@ -683,7 +683,7 @@ (paper) -
1.17) Where can I get technical +
1.17) Where can I get technical assistance?
Many technical questions held by those new to the code have been @@ -698,7 +698,7 @@ questions about development of new features, on IRC at irc.freenode.net in the #postgresql channel.
-1.18) How do I get involved in PostgreSQL +
1.18) How do I get involved in PostgreSQL web site development?
PostgreSQL website development is discussed on the @@ -714,7 +714,7 @@
Technical Questions
-2.1) How do I efficiently access information +
2.1) How do I efficiently access information in tables from the backend code?
You first need to find the tuples(rows) you are interested in. @@ -782,7 +782,7 @@ ReleaseBuffer(), in the heap_fetch() case. Or it may be a palloc'ed tuple, that you must pfree() when finished. -
2.2) Why are table, column, type, function, +
2.2) Why are table, column, type, function, view names sometimes referenced as Name or NameData, and sometimes as char *?
@@ -809,7 +809,7 @@ names(char *), there are many cases where Name and char * are used interchangeably. -2.3) Why do we use Node and +
2.3) Why do we use Node and List to make data structures?
We do this because this allows a consistent way to pass data @@ -902,7 +902,7 @@ The output appears in the postmaster log file, or on your screen if you are running a backend directly without a postmaster. -
2.4) I just added a field to a structure. +
2.4) I just added a field to a structure. What else should I do?
The structures passing around from the parser, rewrite, @@ -912,9 +912,9 @@ the files copyfuncs.c and equalfuncs.c. Make sure you add support for your new field to these files. Find any other places the structure might need code for your new field. mkid - is helpful with this (see 1.9).
+ is helpful with this (see 1.9). -2.5) Why do we use palloc() and +
2.5) Why do we use palloc() and pfree() to allocate memory?
palloc() and pfree() are used in place of malloc() @@ -925,7 +925,7 @@ memory can be allocated in. These affect when the allocated memory is freed by the backend.
-2.6) What is ereport()?
+2.6) What is ereport()?
ereport() is used to send messages to the front-end, and optionally terminate the current query being processed. The first @@ -944,7 +944,7 @@ descriptors so you don't need to clean these up before the call.
-2.7) What is CommandCounterIncrement()?
+2.7) What is CommandCounterIncrement()?
Normally, transactions can not see the rows they modify. This allows
@@ -957,7 +957,7 @@ increments the Command Counter, creating a new part of the transaction. -UPDATE foo SET x = x + 1
to work correctly.2.8) What debugging features are +
2.8) What debugging features are available?
First, try running configure with the --enable-cassert -- 2.11.0