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