Update pgcvslog

This commit is contained in:
Bruce Momjian 2000-06-01 01:34:02 +00:00
parent 127f785028
commit 726926a523
4 changed files with 345 additions and 146 deletions

View File

@ -192,7 +192,8 @@ PERFORMANCE
FSYNC
* Allow transaction commits with rollback with no-fsync performance [fsync](Vadim)
* Allow transaction commits with rollback with no-fsync performance
[fsync] (Vadim)
INDEXES
@ -231,6 +232,7 @@ MISC
* Remove pg_listener index
* Remove ANALYZE from VACUUM so it can be run separately without locks
* Gather more accurate statistics using indexes
* Improve statistics storage in pg_class [performance]
SOURCE CODE
-----------

View File

@ -341,3 +341,214 @@ Informix Software (No, really) 300 Lakeside Drive Oakland, CA 94612
good, you'll have to ram them down people's throats." -- Howard Aiken
From owner-pgsql-hackers@hub.org Tue Oct 19 10:31:10 1999
Received: from renoir.op.net (root@renoir.op.net [209.152.193.4])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id KAA29087
for <maillist@candle.pha.pa.us>; Tue, 19 Oct 1999 10:31:08 -0400 (EDT)
Received: from hub.org (hub.org [216.126.84.1]) by renoir.op.net (o1/$Revision: 1.2 $) with ESMTP id KAA27535 for <maillist@candle.pha.pa.us>; Tue, 19 Oct 1999 10:19:47 -0400 (EDT)
Received: from localhost (majordom@localhost)
by hub.org (8.9.3/8.9.3) with SMTP id KAA30328;
Tue, 19 Oct 1999 10:12:10 -0400 (EDT)
(envelope-from owner-pgsql-hackers)
Received: by hub.org (bulk_mailer v1.5); Tue, 19 Oct 1999 10:11:55 -0400
Received: (from majordom@localhost)
by hub.org (8.9.3/8.9.3) id KAA30030
for pgsql-hackers-outgoing; Tue, 19 Oct 1999 10:11:00 -0400 (EDT)
(envelope-from owner-pgsql-hackers@postgreSQL.org)
Received: from sss.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2])
by hub.org (8.9.3/8.9.3) with ESMTP id KAA29914
for <pgsql-hackers@postgreSQL.org>; Tue, 19 Oct 1999 10:10:33 -0400 (EDT)
(envelope-from tgl@sss.pgh.pa.us)
Received: from sss.sss.pgh.pa.us (localhost [127.0.0.1])
by sss.sss.pgh.pa.us (8.9.1/8.9.1) with ESMTP id KAA09038;
Tue, 19 Oct 1999 10:09:15 -0400 (EDT)
To: "Hiroshi Inoue" <Inoue@tpf.co.jp>
cc: "Vadim Mikheev" <vadim@krs.ru>, pgsql-hackers@postgreSQL.org
Subject: Re: [HACKERS] mdnblocks is an amazing time sink in huge relations
In-reply-to: Your message of Tue, 19 Oct 1999 19:03:22 +0900
<000801bf1a19$2d88ae20$2801007e@cadzone.tpf.co.jp>
Date: Tue, 19 Oct 1999 10:09:15 -0400
Message-ID: <9036.940342155@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
Sender: owner-pgsql-hackers@postgreSQL.org
Status: OR
"Hiroshi Inoue" <Inoue@tpf.co.jp> writes:
> 1. shared cache holds committed system tuples.
> 2. private cache holds uncommitted system tuples.
> 3. relpages of shared cache are updated immediately by
> phisical change and corresponding buffer pages are
> marked dirty.
> 4. on commit, the contents of uncommitted tuples except
> relpages,reltuples,... are copied to correponding tuples
> in shared cache and the combined contents are
> committed.
> If so,catalog cache invalidation would be no longer needed.
> But synchronization of the step 4. may be difficult.
I think the main problem is that relpages and reltuples shouldn't
be kept in pg_class columns at all, because they need to have
very different update behavior from the other pg_class columns.
The rest of pg_class is update-on-commit, and we can lock down any one
row in the normal MVCC way (if transaction A has modified a row and
transaction B also wants to modify it, B waits for A to commit or abort,
so it can know which version of the row to start from). Furthermore,
there can legitimately be several different values of a row in use in
different places: the latest committed, an uncommitted modification, and
one or more old values that are still being used by active transactions
because they were current when those transactions started. (BTW, the
present relcache is pretty bad about maintaining pure MVCC transaction
semantics like this, but it seems clear to me that that's the direction
we want to go in.)
relpages cannot operate this way. To be useful for avoiding lseeks,
relpages *must* change exactly when the physical file changes. It
matters not at all whether the particular transaction that extended the
file ultimately commits or not. Moreover there can be only one correct
value (per relation) across the whole system, because there is only one
length of the relation file.
If we want to take reltuples seriously and try to maintain it
on-the-fly, then I think it needs still a third behavior. Clearly
it cannot be updated using MVCC rules, or we lose all writer
concurrency (if A has added tuples to a rel, B would have to wait
for A to commit before it could update reltuples...). Furthermore
"updating" isn't a simple matter of storing what you think the new
value is; otherwise two transactions adding tuples in parallel would
leave the wrong answer after B commits and overwrites A's value.
I think it would work for each transaction to keep track of a net delta
in reltuples for each table it's changed (total tuples added less total
tuples deleted), and then atomically add that value to the table's
shared reltuples counter during commit. But that still leaves the
problem of how you use the counter during a transaction to get an
accurate answer to the question "If I scan this table now, how many tuples
will I see?" At the time the question is asked, the current shared
counter value might include the effects of transactions that have
committed since your transaction started, and therefore are not visible
under MVCC rules. I think getting the correct answer would involve
making an instantaneous copy of the current counter at the start of
your xact, and then adding your own private net-uncommitted-delta to
the saved shared counter value when asked the question. This doesn't
look real practical --- you'd have to save the reltuples counts of
*all* tables in the database at the start of each xact, on the off
chance that you might need them. Ugh. Perhaps someone has a better
idea. In any case, reltuples clearly needs different mechanisms than
the ordinary fields in pg_class do, because updating it will be a
performance bottleneck otherwise.
If we allow reltuples to be updated only by vacuum-like events, as
it is now, then I think keeping it in pg_class is still OK.
In short, it seems clear to me that relpages should be removed from
pg_class and kept somewhere else if we want to make it more reliable
than it is now, and the same for reltuples (but reltuples doesn't
behave the same as relpages, and probably ought to be handled
differently).
regards, tom lane
************
From owner-pgsql-hackers@hub.org Tue Oct 19 21:25:30 1999
Received: from renoir.op.net (root@renoir.op.net [209.152.193.4])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id VAA28130
for <maillist@candle.pha.pa.us>; Tue, 19 Oct 1999 21:25:26 -0400 (EDT)
Received: from hub.org (hub.org [216.126.84.1]) by renoir.op.net (o1/$Revision: 1.2 $) with ESMTP id VAA10512 for <maillist@candle.pha.pa.us>; Tue, 19 Oct 1999 21:15:28 -0400 (EDT)
Received: from localhost (majordom@localhost)
by hub.org (8.9.3/8.9.3) with SMTP id VAA50745;
Tue, 19 Oct 1999 21:07:23 -0400 (EDT)
(envelope-from owner-pgsql-hackers)
Received: by hub.org (bulk_mailer v1.5); Tue, 19 Oct 1999 21:07:01 -0400
Received: (from majordom@localhost)
by hub.org (8.9.3/8.9.3) id VAA50644
for pgsql-hackers-outgoing; Tue, 19 Oct 1999 21:06:06 -0400 (EDT)
(envelope-from owner-pgsql-hackers@postgreSQL.org)
Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34])
by hub.org (8.9.3/8.9.3) with ESMTP id VAA50584
for <pgsql-hackers@postgreSQL.org>; Tue, 19 Oct 1999 21:05:26 -0400 (EDT)
(envelope-from Inoue@tpf.co.jp)
Received: from cadzone ([126.0.1.40] (may be forged))
by sd.tpf.co.jp (2.5 Build 2640 (Berkeley 8.8.6)/8.8.4) with SMTP
id KAA01715; Wed, 20 Oct 1999 10:05:14 +0900
From: "Hiroshi Inoue" <Inoue@tpf.co.jp>
To: "Tom Lane" <tgl@sss.pgh.pa.us>
Cc: <pgsql-hackers@postgreSQL.org>
Subject: RE: [HACKERS] mdnblocks is an amazing time sink in huge relations
Date: Wed, 20 Oct 1999 10:09:13 +0900
Message-ID: <000501bf1a97$b925a860$2801007e@cadzone.tpf.co.jp>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0
X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4
Importance: Normal
Sender: owner-pgsql-hackers@postgreSQL.org
Status: ORr
> -----Original Message-----
> From: Hiroshi Inoue [mailto:Inoue@tpf.co.jp]
> Sent: Tuesday, October 19, 1999 6:45 PM
> To: Tom Lane
> Cc: pgsql-hackers@postgreSQL.org
> Subject: RE: [HACKERS] mdnblocks is an amazing time sink in huge
> relations
>
>
> >
> > "Hiroshi Inoue" <Inoue@tpf.co.jp> writes:
>
> [snip]
>
> >
> > > Deletion is necessary only not to consume disk space.
> > >
> > > For example vacuum could remove not deleted files.
> >
> > Hmm ... interesting idea ... but I can hear the complaints
> > from users already...
> >
>
> My idea is only an analogy of PostgreSQL's simple recovery
> mechanism of tuples.
>
> And my main point is
> "delete fails after commit" doesn't harm the database
> except that not deleted files consume disk space.
>
> Of cource,it's preferable to delete relation files immediately
> after(or just when) commit.
> Useless files are visible though useless tuples are invisible.
>
Anyway I don't need "DROP TABLE inside transactions" now
and my idea is originally for that issue.
After a thought,I propose the following solution.
1. mdcreate() couldn't create existent relation files.
If the existent file is of length zero,we would overwrite
the file.(seems the comment in md.c says so but the
code doesn't do so).
If the file is an Index relation file,we would overwrite
the file.
2. mdunlink() couldn't unlink non-existent relation files.
mdunlink() doesn't call elog(ERROR) even if the file
doesn't exist,though I couldn't find where to change
now.
mdopen() doesn't call elog(ERROR) even if the file
doesn't exist and leaves the relation as CLOSED.
Comments ?
Regards.
Hiroshi Inoue
Inoue@tpf.co.jp
************

View File

@ -28,109 +28,109 @@ HREF="http://www.PostgreSQL.org/docs/faq-hpux.shtml">http://www.PostgreSQL.org/d
<H2><CENTER>General Questions</CENTER></H2>
<A HREF="#1.1">1.1</A>) What is PostgreSQL?<BR>
<A HREF="#1.2">1.2</A>) What's the copyright on PostgreSQL?<BR>
<A HREF="#1.3">1.3</A>) What Unix platforms does PostgreSQL run on?<BR>
<A HREF="#1.1">1.1</A>) What is PostgreSQL?<BR>
<A HREF="#1.2">1.2</A>) What's the copyright on PostgreSQL?<BR>
<A HREF="#1.3">1.3</A>) What Unix platforms does PostgreSQL run on?<BR>
<A HREF="#1.4">1.4</A>) What non-unix ports are available?<BR>
<A HREF="#1.5">1.5</A>) Where can I get PostgreSQL?<BR>
<A HREF="#1.6">1.6</A>) Where can I get support for PostgreSQL?<BR>
<A HREF="#1.7">1.7</A>) What is the latest release of PostgreSQL?<BR>
<A HREF="#1.8">1.8</A>) What documentation is available for PostgreSQL?<BR>
<A HREF="#1.9">1.9</A>) How do I find out about known bugs or missing features?<BR>
<A HREF="#1.10">1.10</A>) How can I learn SQL?<BR>
<A HREF="#1.11">1.11</A>) Is PostgreSQL Y2K compliant?<BR>
<A HREF="#1.12">1.12</A>) How do I join the development team?<BR>
<A HREF="#1.13">1.13</A>) How do I submit a bug report?<BR>
<A HREF="#1.14">1.14</A>) How does PostgreSQL compare to other DBMS's?<BR>
<A HREF="#1.5">1.5</A>) Where can I get PostgreSQL?<BR>
<A HREF="#1.6">1.6</A>) Where can I get support for PostgreSQL?<BR>
<A HREF="#1.7">1.7</A>) What is the latest release of PostgreSQL?<BR>
<A HREF="#1.8">1.8</A>) What documentation is available for PostgreSQL?<BR>
<A HREF="#1.9">1.9</A>) How do I find out about known bugs or missing features?<BR>
<A HREF="#1.10">1.10</A>) How can I learn SQL?<BR>
<A HREF="#1.11">1.11</A>) Is PostgreSQL Y2K compliant?<BR>
<A HREF="#1.12">1.12</A>) How do I join the development team?<BR>
<A HREF="#1.13">1.13</A>) How do I submit a bug report?<BR>
<A HREF="#1.14">1.14</A>) How does PostgreSQL compare to other DBMS's?<BR>
<A HREF="#1.15">1.15</A>) What are the maximum size limits?
<H2><CENTER>User Client Questions</CENTER></H2>
<A HREF="#2.1">2.1</A>) Are there ODBC drivers for
<A HREF="#2.1">2.1</A>) Are there ODBC drivers for
PostgreSQL?<BR>
<A HREF="#2.2">2.2</A>) What tools are available for hooking
<A HREF="#2.2">2.2</A>) What tools are available for hooking
PostgreSQL to Web pages?<BR>
<A HREF="#2.3">2.3</A>) Does PostgreSQL have a graphical user interface?
<A HREF="#2.3">2.3</A>) Does PostgreSQL have a graphical user interface?
A report generator? An embedded query language interface?<BR>
<A HREF="#2.4">2.4</A>) What languages are available to communicate
<A HREF="#2.4">2.4</A>) What languages are available to communicate
with PostgreSQL?<BR>
<H2><CENTER>Administrative Questions</CENTER></H2>
<A HREF="#3.1">3.1</A>) Why does initdb fail?<BR>
<A HREF="#3.2">3.2</A>) How do I install PostgreSQL somewhere other than
<A HREF="#3.1">3.1</A>) Why does initdb fail?<BR>
<A HREF="#3.2">3.2</A>) How do I install PostgreSQL somewhere other than
/usr/local/pgsql?<BR>
<A HREF="#3.3">3.3</A>) When I start the postmaster, I get a
<A HREF="#3.3">3.3</A>) When I start the postmaster, I get a
<I>Bad System Call</I> or core dumped message. Why?<BR>
<A HREF="#3.4">3.4</A>) When I try to start the postmaster, I get
<A HREF="#3.4">3.4</A>) When I try to start the postmaster, I get
<I>IpcMemoryCreate</I> errors3. Why?<BR>
<A HREF="#3.5">3.5</A>) When I try to start the postmaster, I get
<I>IpcSemaphoreCreate</I> errors. Why?<BR>
<A HREF="#3.6">3.6</A>) How do I prevent other hosts from accessing my
<A HREF="#3.6">3.6</A>) How do I prevent other hosts from accessing my
PostgreSQL database?<BR>
<A HREF="#3.7">3.7</A>) Why can't I connect to my database from
<A HREF="#3.7">3.7</A>) Why can't I connect to my database from
another machine?<BR>
<A HREF="#3.8">3.8</A>) Why can't I access the database as the
<A HREF="#3.8">3.8</A>) Why can't I access the database as the
<I>root</I> user?<BR>
<A HREF="#3.9">3.9</A>) All my servers crash under concurrent
<A HREF="#3.9">3.9</A>) All my servers crash under concurrent
table access. Why?<BR>
<A HREF="#3.10">3.10</A>) How do I tune the database engine for
<A HREF="#3.10">3.10</A>) How do I tune the database engine for
better performance?<BR>
<A HREF="#3.11">3.11</A>) What debugging features are available in
<A HREF="#3.11">3.11</A>) What debugging features are available in
PostgreSQL?<BR>
<A HREF="#3.12">3.12</A>) I get 'Sorry, too many clients' when trying to
connect. Why?<BR>
<A HREF="#3.13">3.13</A>) What are the pg_psort.XXX files in my
<A HREF="#3.13">3.13</A>) What are the pg_psort.XXX files in my
database directory?<BR>
<A HREF="#3.14">3.14</A>) How do I set up a pg_group?<BR>
<H2><CENTER>Operational Questions</CENTER></H2>
<A HREF="#4.1">4.1</A>) The system seems to be confused about commas,
<A HREF="#4.1">4.1</A>) The system seems to be confused about commas,
decimal points, and date formats.<BR>
<A HREF="#4.2">4.2</A>) What is the exact difference between
<A HREF="#4.2">4.2</A>) What is the exact difference between
binary cursors and normal cursors?<BR>
<A HREF="#4.3">4.3</A>) How do I <I>select</I> only the first few rows of
<A HREF="#4.3">4.3</A>) How do I <I>select</I> only the first few rows of
a query?<BR>
<A HREF="#4.4">4.4</A>) How do I get a list of tables, or other
<A HREF="#4.4">4.4</A>) How do I get a list of tables, or other
things I can see in <I>psql?</I><BR>
<A HREF="#4.5">4.5</A>) How do you remove a column from a table?<BR>
<A HREF="#4.5">4.5</A>) How do you remove a column from a table?<BR>
<A HREF="#4.6">4.6</A>) What is the maximum size for a
<A HREF="#4.6">4.6</A>) What is the maximum size for a
row, table, database?<BR>
<A HREF="#4.7">4.7</A>) How much database disk space is required
<A HREF="#4.7">4.7</A>) How much database disk space is required
to store data from a typical flat file?<BR>
<A HREF="#4.8">4.8</A>) How do I find out what indices or
<A HREF="#4.8">4.8</A>) How do I find out what indices or
operations are defined in the database?<BR>
<A HREF="#4.9">4.9</A>) My queries are slow or don't make use of the
<A HREF="#4.9">4.9</A>) My queries are slow or don't make use of the
indexes. Why?<BR>
<A HREF="#4.10">4.10</A>) How do I see how the query optimizer is
<A HREF="#4.10">4.10</A>) How do I see how the query optimizer is
evaluating my query?<BR>
<A HREF="#4.11">4.11</A>) What is an R-tree index?<BR>
<A HREF="#4.12">4.12</A>) What is Genetic Query Optimization?<BR>
<A HREF="#4.11">4.11</A>) What is an R-tree index?<BR>
<A HREF="#4.12">4.12</A>) What is Genetic Query Optimization?<BR>
<A HREF="#4.13">4.13</A>) How do I do regular expression searches
<A HREF="#4.13">4.13</A>) How do I do regular expression searches
and case-insensitive regexp searching?<BR>
<A HREF="#4.14">4.14</A>) In a query, how do I detect if a field
<A HREF="#4.14">4.14</A>) In a query, how do I detect if a field
is NULL?<BR>
<A HREF="#4.15">4.15</A>) What is the difference between the
<A HREF="#4.15">4.15</A>) What is the difference between the
various character types?<BR>
<A HREF="#4.16.1">4.16.1</A>) How do I create a serial/auto-incrementing field?<BR>
<A HREF="#4.16.2">4.16.2</A>) How do I get the value of a serial insert?<BR>
<A HREF="#4.16.3">4.16.3</A>) Wouldn't use of currval() and nextval() lead to a race condition with other concurrent backend processes?<BR>
<A HREF="#4.16.1">4.16.1</A>) How do I create a serial/auto-incrementing field?<BR>
<A HREF="#4.16.2">4.16.2</A>) How do I get the value of a serial insert?<BR>
<A HREF="#4.16.3">4.16.3</A>) Wouldn't use of currval() and nextval() lead to a race condition with other concurrent backend processes?<BR>
<A HREF="#4.17">4.17</A>) What is an oid? What is a tid?<BR>
<A HREF="#4.18">4.18</A>) What is the meaning of some of the terms
<A HREF="#4.17">4.17</A>) What is an oid? What is a tid?<BR>
<A HREF="#4.18">4.18</A>) What is the meaning of some of the terms
used in PostgreSQL?<BR>
<A HREF="#4.19">4.19</A>) Why do I get the error "FATAL: palloc
<A HREF="#4.19">4.19</A>) Why do I get the error "FATAL: palloc
failure: memory exhausted?"<BR>
<A HREF="#4.20">4.20</A>) How do I tell what PostgreSQL version I
<A HREF="#4.20">4.20</A>) How do I tell what PostgreSQL version I
am running? <BR>
<A HREF="#4.21">4.21</A>) My large-object operations get <I>invalid
<A HREF="#4.21">4.21</A>) My large-object operations get <I>invalid
large obj descriptor.</I> Why?<BR>
<A HREF="#4.22">4.22</A>) How do I create a column that will default to the
current time?<BR>
@ -138,15 +138,15 @@ current time?<BR>
<H2><CENTER>Extending PostgreSQL</CENTER></H2>
<A HREF="#5.1">5.1</A>) I wrote a user-defined function. When I run
<A HREF="#5.1">5.1</A>) I wrote a user-defined function. When I run
it in <I>psql,</I> why does it dumps core?<BR>
<A HREF="#5.2">5.2</A>) What does the message:
<A HREF="#5.2">5.2</A>) What does the message:
<I>NOTICE:PortalHeapMemoryFree: 0x402251d0 not in alloc set!</I> mean?<BR>
<A HREF="#5.3">5.3</A>) How can I contribute some nifty new types and functions
<A HREF="#5.3">5.3</A>) How can I contribute some nifty new types and functions
for PostgreSQL?<BR>
<A HREF="#5.4">5.4</A>) How do I write a C function to return a
<A HREF="#5.4">5.4</A>) How do I write a C function to return a
tuple?<BR>
<A HREF="#5.5">5.5</A>) I have changed a source file. Why does the
<A HREF="#5.5">5.5</A>) I have changed a source file. Why does the
recompile does not see the change?<BR>
@ -154,7 +154,7 @@ recompile does not see the change?<BR>
<H2><CENTER>General Questions</CENTER></H2>
<H4><A
NAME="1.1">1.1</A>) What is PostgreSQL?</H4><P>
NAME="1.1">1.1</A>) What is PostgreSQL?</H4><P>
PostgreSQL is an enhancement of the POSTGRES database management system,
a next-generation DBMS research prototype. While PostgreSQL retains the
@ -183,7 +183,7 @@ name was changed at the end of 1996 to PostgreSQL.<P>
It is pronounced <I>Post-Gres-Q-L.</I>
<H4><A NAME="1.2">1.2</A>) What's the copyright on
<H4><A NAME="1.2">1.2</A>) What's the copyright on
PostgreSQL?</H4><P>
PostgreSQL is subject to the following COPYRIGHT.<P>
@ -215,7 +215,7 @@ MODIFICATIONS.<P>
<H4><A NAME="1.3">1.3</A>) What Unix platforms does PostgreSQL run
<H4><A NAME="1.3">1.3</A>) What Unix platforms does PostgreSQL run
on?</H4><P>
The authors have compiled and tested PostgreSQL on the following
@ -243,7 +243,7 @@ platforms (some of these compiles require gcc):
</UL>
<P>
<H4><A NAME="1.4">1.4</A>) What non-unix ports are available?</H4><P>
<H4><A NAME="1.4">1.4</A>) What non-unix ports are available?</H4><P>
It is possible to compile the libpq C library, psql, and other
interfaces and binaries to run on MS Windows platforms. In this case,
@ -263,14 +263,14 @@ There is another port using U/Win at <A HREF=
"http://surya.wipro.com/uwin/ported.html">http://surya.wipro.com/uwin/ported.html.</A>
<H4><A NAME="1.5">1.5</A>) Where can I get PostgreSQL?</H4><P>
<H4><A NAME="1.5">1.5</A>) Where can I get PostgreSQL?</H4><P>
The primary anonymous ftp site for PostgreSQL is
<A
HREF="ftp://ftp.postgreSQL.org/pub">ftp://ftp.postgreSQL.org/pub</A>
<P>
For mirror sites, see our main web site.
<H4><A NAME="1.6">1.6</A>) Where can I get support for PostgreSQL?</H4><P>
<H4><A NAME="1.6">1.6</A>) Where can I get support for PostgreSQL?</H4><P>
There is no official support for PostgreSQL from the University of
California, Berkeley. It is maintained through volunteer effort.<P>
@ -336,14 +336,14 @@ Commercial support for PostgreSQL is available at <A
HREF="http://www.pgsql.com">http://www.pgsql.com/</A><P>
<H4><A NAME="1.7">1.7</A>) What is the latest release of PostgreSQL?</H4><P>
<H4><A NAME="1.7">1.7</A>) What is the latest release of PostgreSQL?</H4><P>
The latest release of PostgreSQL is version 7.0.<P>
We plan to have major releases every four months.<P>
<H4><A NAME="1.8">1.8</A>) What documentation is available for PostgreSQL?</H4><P>
<H4><A NAME="1.8">1.8</A>) What documentation is available for PostgreSQL?</H4><P>
Several manuals, manual pages, and some small test examples are
included in the distribution. See the /doc directory. You can also
@ -358,14 +358,14 @@ operators, functions, aggregates, etc.<P>
The web site contains even more documentation.<P>
<H4><A NAME="1.9">1.9</A>) How do I find out about known bugs or missing features?
<H4><A NAME="1.9">1.9</A>) How do I find out about known bugs or missing features?
</H4><P>
PostgreSQL supports an extended subset of SQL-92. See our
<A HREF="http://www.postgreSQL.org/docs/todo.html">
TODO</A> for a list of known bugs, missing features, and future plans.<P>
<H4><A NAME="1.10">1.10</A>) How can I learn SQL?</H4><P>
<H4><A NAME="1.10">1.10</A>) How can I learn SQL?</H4><P>
There is a nice tutorial at <A
HREF="http://w3.one.net/~jhoffman/sqltut.htm">
@ -382,12 +382,12 @@ Addison Wesley. Others like <I>Lan Times Guide to SQL</I>, Groff et al.,
Osborne McGraw-Hill.<P>
<H4><A NAME="1.11">1.11</A>) Is PostgreSQL Y2K compliant?</H4><P>
<H4><A NAME="1.11">1.11</A>) Is PostgreSQL Y2K compliant?</H4><P>
Yes, we easily handle dates past the year 2000AD, and before 2000BC.<P>
<H4><A NAME="1.12">1.12</A>) How do I join the development team?</H4><P>
<H4><A NAME="1.12">1.12</A>) How do I join the development team?</H4><P>
First, download the latest sources and read the PostgreSQL Developers
documentation on our web site, or in the distribution.
@ -400,7 +400,7 @@ high-quality patches that it was a pain for the existing
committers to keep up, and we had confidence that patches they
committed were likely to be of high quality.
<H4><A NAME="1.13">1.13</A>) How do I submit a bug report?</H4><P>
<H4><A NAME="1.13">1.13</A>) How do I submit a bug report?</H4><P>
Fill out the "bug-template" file and send it to: <A
HREF="mailto:bugs@postgreSQL.org">bugs@postgreSQL.org</A><P>
@ -410,7 +410,7 @@ HREF="ftp://ftp.postgreSQL.org/pub">ftp://ftp.postgreSQL.org/pub</A> to
see if there is a more recent PostgreSQL version or patches.<P>
<H4><A NAME="1.14">1.14</A>) How does PostgreSQL compare to other
<H4><A NAME="1.14">1.14</A>) How does PostgreSQL compare to other
DBMS's?</H4><P>
There are several ways of measuring software: features, performance,
@ -484,6 +484,19 @@ add our code to your product with no limitations, except those outlined
in our BSD-style license stated above.<BR><BR>
</DL>
<H4><A NAME="1.14">1.14</A>) What are the maximum size limits?</H4><P>
These are the limits:
<PRE>
Maximum size for a database? unlimited (60GB databases exist)
Maximum size for a table? unlimited on all operating systems
Maximum size for a row? 8k, configurable to 32k
Maximum number of rows in a table? unlimited
Maximum number of columns table? unlimited
Maximun number of indexes on a table? unlimited
</PRE>
The row length limit will be removed in 7.1.<P>
<HR>
@ -492,7 +505,7 @@ in our BSD-style license stated above.<BR><BR>
<H4><A NAME="2.1">2.1</A>) Are there ODBC drivers for PostgreSQL?</H4><P>
<H4><A NAME="2.1">2.1</A>) Are there ODBC drivers for PostgreSQL?</H4><P>
There are two ODBC drivers available, PostODBC and OpenLink ODBC.<P>
@ -512,7 +525,7 @@ HREF="mailto:postgres95@openlink.co.uk">postgres95@openlink.co.uk</A>.<P>
<H4><A NAME="2.2">2.2</A>) What tools are available for hooking
<H4><A NAME="2.2">2.2</A>) What tools are available for hooking
PostgreSQL to Web pages?</H4><P>
A nice introduction to Database-backed Web pages can be seen at: <A
@ -530,7 +543,7 @@ use the perl interface and CGI.pm.<P>
A WWW gateway based on WDB using perl can be downloaded from <A
HREF="http://www.eol.ists.ca/~dunlop/wdb-p95">http://www.eol.ists.ca/~dunlop/wdb-p95</A>
<H4><A NAME="2.3">2.3</A>) Does PostgreSQL have a graphical user interface?
<H4><A NAME="2.3">2.3</A>) Does PostgreSQL have a graphical user interface?
A report generator? An embedded query language interface?</H4><P>
We have a nice graphical user interface called <I>pgaccess,</I> which is
@ -541,7 +554,7 @@ generator. The web page is <A HREF=
We also include <I>ecpg,</I> which is an embedded SQL query language interface for
C.
<H4><A NAME="2.4">2.4</A>) What languages are available to
<H4><A NAME="2.4">2.4</A>) What languages are available to
communicate with PostgreSQL?</H4><P>
We have:
@ -563,7 +576,7 @@ We have:
<H2><CENTER>Administrative Questions</CENTER></H2><P>
<H4><A NAME="3.1">3.1</A>) Why does initdb fail?</H4><P>
<H4><A NAME="3.1">3.1</A>) Why does initdb fail?</H4><P>
<UL>
<LI> check that you don't have any of the previous version's binaries in
@ -574,7 +587,7 @@ your path (If you see the message <CODE>WARN:heap_modifytuple: repl is
</UL><P>
<H4><A NAME="3.2">3.2</A>) How do I install PostgreSQL somewhere
<H4><A NAME="3.2">3.2</A>) How do I install PostgreSQL somewhere
other than /usr/local/pgsql?</H4><P>
The simplest way is to specify the --prefix option when running configure.
@ -582,7 +595,7 @@ If you forgot to do that, you can edit Makefile.global and change POSTGRESDIR
accordingly, or create a Makefile.custom and define POSTGRESDIR there.<P>
<H4><A NAME="3.3">3.3</A>) When I start the postmaster, I get a <I>Bad
<H4><A NAME="3.3">3.3</A>) When I start the postmaster, I get a <I>Bad
System Call</I> or core dumped message. Why?</H4><P>
It could be a variety of problems, but first check to see that you
@ -590,7 +603,7 @@ have system V extensions installed in your kernel. PostgreSQL requires
kernel support for shared memory and semaphores.<P>
<H4><A NAME="3.4">3.4</A>) When I try to start the postmaster, I
<H4><A NAME="3.4">3.4</A>) When I try to start the postmaster, I
get <I>IpcMemoryCreate</I> errors. Why?</H4><P>
You either do not have shared memory configured properly in kernel or
@ -600,7 +613,7 @@ and backend processes you configure postmaster to run with.
For most systems, with default numbers of buffers and processes, you
need a minimum of ~1MB.<P>
<H4><A NAME="3.5">3.5</A>) When I try to start the postmaster, I
<H4><A NAME="3.5">3.5</A>) When I try to start the postmaster, I
get <I>IpcSemaphoreCreate</I> errors. Why?</H4><P>
If the error message is <I>IpcSemaphoreCreate: semget failed (No space
@ -615,7 +628,7 @@ If the error message is something else, you might not have semaphore
support configured in your kernel at all.<P>
<H4><A NAME="3.6">3.6</A>) How do I prevent other hosts from
<H4><A NAME="3.6">3.6</A>) How do I prevent other hosts from
accessing my PostgreSQL database?</H4><P>
By default, PostgreSQL only allows connections from the local machine
@ -625,7 +638,7 @@ unless you add the <I>-i</I> flag to the <I>postmaster,</I>
<I>$PGDATA/pg_hba.conf</I> accordingly. This will allow TCP/IP connections.
<P>
<H4><A NAME="3.7">3.7</A>) Why can't I connect to my database from
<H4><A NAME="3.7">3.7</A>) Why can't I connect to my database from
another machine?</H4><P>
The default configuration allows only unix domain socket connections
@ -635,7 +648,7 @@ appropriate host entry to the file
<I>pgsql/data/pg_hba.conf</I>. See the <I>pg_hba.conf</I> manual page.<P>
<H4><A NAME="3.8">3.8</A>) Why can't I access the database as the <I>root</I>
<H4><A NAME="3.8">3.8</A>) Why can't I access the database as the <I>root</I>
user?</H4><P>
You should not create database users with user id 0 (root). They will be
@ -644,14 +657,14 @@ of the ability of any user to dynamically link object modules into the
database engine.<P>
<H4><A NAME="3.9">3.9</A>) All my servers crash under concurrent
<H4><A NAME="3.9">3.9</A>) All my servers crash under concurrent
table access. Why?</H4><P>
This problem can be caused by a kernel that is not configured to support
semaphores.<P>
<H4><A NAME="3.10">3.10</A>) How do I tune the database engine for
<H4><A NAME="3.10">3.10</A>) How do I tune the database engine for
better performance?</H4><P>
Certainly, indices can speed up queries. The <SMALL>EXPLAIN</SMALL> command
@ -685,7 +698,7 @@ You can also use the <SMALL>CLUSTER</SMALL> command to group data in base tables
match an index. See the cluster(l) manual page for more details.<P>
<H4><A NAME="3.11">3.11</A>) What debugging features are available in
<H4><A NAME="3.11">3.11</A>) What debugging features are available in
PostgreSQL?</H4><P>
PostgreSQL has several features that report status information that can
@ -763,7 +776,7 @@ In Postgres versions prior to 6.5, the maximum number of backends was
64, and changing it required a rebuild after altering the MaxBackendId
constant in <I>include/storage/sinvaladt.h.</I><P>
<H4><A NAME="3.13">3.13</A>) What are the pg_tempNNN.NN files in my
<H4><A NAME="3.13">3.13</A>) What are the pg_tempNNN.NN files in my
database directory?</H4><P>
They are temporary files generated by the query executor. For
@ -775,38 +788,12 @@ The temp files should go away automatically, but might not if a backend
crashes during a sort. If you have no transactions running at the time,
it is safe to delete the pg_tempNNN.NN files.<P>
<H4><A NAME="3.14">3.14</A>) How do I set up a pg_group?</H4><P>
Currently, there is no easy interface to set up user groups. You have to
explicitly insert/update the pg_group table. For example:
<PRE>
jolly=&gt; insert into pg_group (groname, grosysid, grolist)
jolly=&gt; values ('posthackers', '1234', '{5443, 8261}');
INSERT 548224
jolly=&gt; grant insert on foo to group posthackers;
CHANGE
jolly=&gt;
</PRE><P>
The fields in pg_group are:
<UL>
<LI>groname: the group name. This a name and should
be purely alphanumeric. Do not include underscores
or other punctuation.
<LI>grosysid: the group id. This is an int4.
This should be unique for each group.
<LI>grolist: the list of pg_user id's that belong in the group.
This is an int4[].
</UL><P>
<HR>
<H2><CENTER>Operational Questions</CENTER></H2><P>
<H4><A NAME="4.1">4.1</A>) The system seems to be confused about
<H4><A NAME="4.1">4.1</A>) The system seems to be confused about
commas, decimal points, and date formats.</H4><P>
Check your locale configuration. PostgreSQL uses the locale settings of
@ -815,12 +802,12 @@ SET commands to control the date format. Set those accordingly for
your operating environment.<P>
<H4><A NAME="4.2">4.2</A>) What is the exact difference between
<H4><A NAME="4.2">4.2</A>) What is the exact difference between
binary cursors and normal cursors?</H4><P>
See the <SMALL>DECLARE</SMALL> manual page for a description.<P>
<H4><A NAME="4.3">4.3</A>) How do I <SMALL>SELECT</SMALL> only the first few
<H4><A NAME="4.3">4.3</A>) How do I <SMALL>SELECT</SMALL> only the first few
rows of a query?</H4><P>
See the <SMALL>FETCH</SMALL> manual page, or use SELECT ... LIMIT....<P>
@ -842,7 +829,7 @@ with the <I>-E</I> option so that it will print out the queries it uses
to execute the commands you give.<P>
<H4><A NAME="4.5">4.5</A>) How do you remove a column from a
<H4><A NAME="4.5">4.5</A>) How do you remove a column from a
table?</H4><P>
We do not support <SMALL>ALTER TABLE DROP COLUMN,</SMALL> but do
@ -858,7 +845,7 @@ this:
<H4><A NAME="4.6">4.6</A>) What is the maximum size for a
<H4><A NAME="4.6">4.6</A>) What is the maximum size for a
row, table, database?</H4><P>
Rows are limited to 8K bytes, but this can be changed by editing
@ -904,7 +891,7 @@ this data can be estimated at 14MB:
Indexes do not contain as much overhead, but do contain the data that is
being indexed, so they can be large also.<P>
<H4><A NAME="4.8">4.8</A>) How do I find out what indices or
<H4><A NAME="4.8">4.8</A>) How do I find out what indices or
operations are defined in the database?</H4><P>
<I>psql</I> has a variety of backslash commands to show such information. Use
@ -915,7 +902,7 @@ illustrates many of the <SMALL>SELECT</SMALL>s needed to get information from
the database system tables.<P>
<H4><A NAME="4.9">4.9</A>) My queries are slow or don't make
<H4><A NAME="4.9">4.9</A>) My queries are slow or don't make
use of the indexes. Why?</H4><P>
PostgreSQL does not automatically maintain statistics. One has to make
@ -943,12 +930,12 @@ the string. So, to use indices, <SMALL>LIKE</SMALL> searches should not
begin with <I>%,</I> and <I>~</I>(regular expression searches) should
start with <I>^.</I>
<H4><A NAME="4.10">4.10</A>) How do I see how the query optimizer is
<H4><A NAME="4.10">4.10</A>) How do I see how the query optimizer is
evaluating my query?</H4><P>
See the <SMALL>EXPLAIN</SMALL> manual page.<P>
<H4><A NAME="4.11">4.11</A>) What is an R-tree index?</H4><P>
<H4><A NAME="4.11">4.11</A>) What is an R-tree index?</H4><P>
An r-tree index is used for indexing spatial data. A hash index can't
handle range searches. A B-tree index only handles range searches in a
@ -971,7 +958,7 @@ extending R-trees require a bit of work and we don't currently have any
documentation on how to do it.<P>
<H4><A NAME="4.12">4.12</A>) What is Genetic Query
<H4><A NAME="4.12">4.12</A>) What is Genetic Query
Optimization?</H4><P>
The GEQO module in PostgreSQL is intended to solve the query
@ -983,7 +970,7 @@ For further information see the documentation.
<H4><A NAME="4.13">4.13</A>) How do I do regular expression searches and
<H4><A NAME="4.13">4.13</A>) How do I do regular expression searches and
case-insensitive regexp searching?</H4><P>
The <I>~</I> operator does regular-expression matching, and <I>~*</I>
@ -994,13 +981,13 @@ effect of case-insensitive <SMALL>LIKE</SMALL> with this:
WHERE lower(textfield) LIKE lower(pattern)
</PRE>
<H4><A NAME="4.14">4.14</A>) In a query, how do I detect if a field
<H4><A NAME="4.14">4.14</A>) In a query, how do I detect if a field
is NULL?</H4><P>
You test the column with IS NULL and IS NOT NULL.<P>
<H4><A NAME="4.15">4.15</A>) What is the difference between the
<H4><A NAME="4.15">4.15</A>) What is the difference between the
various character types?</H4>
<PRE>
@ -1025,7 +1012,7 @@ them. Specifically, the penalty is for access to all columns after the
first column of this type.<P>
<H4><A NAME="4.16.1">4.16.1</A>) How do I create a
<H4><A NAME="4.16.1">4.16.1</A>) How do I create a
serial/auto-incrementing field?</H4><P>
PostgreSQL supports <SMALL>SERIAL</SMALL> data type. It auto-creates a
@ -1054,7 +1041,7 @@ option or <SMALL>COPY WITH OIDS</SMALL> option to preserve the oids.<P>
For more details, see Bruce Momjian's chapter on
<A HREF="http://www.postgresql.org/docs/aw_pgsql_book/node74.html">Numbering Rows.</A>
<H4><A NAME="4.16.2">4.16.2</A>) How do I get the back the generated SERIAL value after an insert?</H4><P>
<H4><A NAME="4.16.2">4.16.2</A>) How do I get the back the generated SERIAL value after an insert?</H4><P>
Probably the simplest approach is to to retrieve the next SERIAL value from the sequence object with the <I>nextval()</I> function <I>before</I> inserting and then insert it explicitly. Using the example table in <A HREF="#4.16.1">4.16.1</A>, that might look like this:
<PRE>
$newSerialID = nextval('person_id_seq');
@ -1069,12 +1056,12 @@ Similarly, you could retrieve the just-assigned SERIAL value with the <I>currval
</PRE>
Finally, you could use the <A HREF="#4.17">oid</A> returned from the INSERT statement to lookup the default value, though this is probably the least portable approach. In perl, using DBI with Edmund Mergl's DBD::Pg module, the oid value is made available via $sth->{pg_oid_status} after $sth->execute().
<H4><A NAME="4.16.3">4.16.3</A>) Wouldn't use of currval() and nextval() lead to a race condition with other concurrent backend processes?</H4><P>
<H4><A NAME="4.16.3">4.16.3</A>) Wouldn't use of currval() and nextval() lead to a race condition with other concurrent backend processes?</H4><P>
No. That has been handled by the backends.
<H4><A NAME="4.17">4.17</A>) What is an oid? What is a tid?</H4><P>
<H4><A NAME="4.17">4.17</A>) What is an oid? What is a tid?</H4><P>
Oids are PostgreSQL's answer to unique row ids. Every row that is
created in PostgreSQL gets a unique oid. All oids generated during
@ -1111,7 +1098,7 @@ values. Tids change after rows are modified or reloaded. They are used
by index entries to point to physical rows.<P>
<H4><A NAME="4.18">4.18</A>) What is the meaning of some of the terms
<H4><A NAME="4.18">4.18</A>) What is the meaning of some of the terms
used in PostgreSQL?</H4><P>
Some of the source code and older documentation use terms that have more
@ -1206,20 +1193,20 @@ We hope to fix this limitation in a future release.
<H2><CENTER>Extending PostgreSQL</CENTER></H2><P>
<H4><A NAME="5.1">5.1</A>) I wrote a user-defined function. When
<H4><A NAME="5.1">5.1</A>) I wrote a user-defined function. When
I run it in <I>psql,</I> why does it dump core?</H4><P>
The problem could be a number of things. Try testing your user-defined
function in a stand alone test program first.
<H4><A NAME="5.2">5.2</A>) What does the message:
<H4><A NAME="5.2">5.2</A>) What does the message:
<I>NOTICE:PortalHeapMemoryFree: 0x402251d0 not in alloc set!</I> mean?</H4><P>
You are <I>pfree'ing</I> something that was not <I>palloc'ed.</I>
Beware of mixing <I>malloc/free</I> and <I>palloc/pfree.</I>
<H4><A NAME="5.3">5.3</A>) How can I contribute some nifty new types and
<H4><A NAME="5.3">5.3</A>) How can I contribute some nifty new types and
functions for PostgreSQL?</H4><P>
@ -1227,13 +1214,13 @@ Send your extensions to the pgsql-hackers mailing list, and they will
eventually end up in the <I>contrib/</I> subdirectory.<P>
<H4><A NAME="5.4">5.4</A>) How do I write a C function to return a
<H4><A NAME="5.4">5.4</A>) How do I write a C function to return a
tuple?</H4><P>
This requires wizardry so extreme that the authors have never
tried it, though in principle it can be done.<P>
<H4><A NAME="5.5">5.5</A>) I have changed a source file. Why does the
<H4><A NAME="5.5">5.5</A>) I have changed a source file. Why does the
recompile does not see the change?</H4><P>
The Makefiles do not have the proper dependencies for include files. You

View File

@ -2,16 +2,17 @@
# This utility is used to generate a compact list of changes for each
# release, bjm 2000-02-22
# Usage $0 [-r 'revision pattern'] file
# Usage $0 file
# no branches:
# cvs log -d '>1999-06-14 00:00:00 GMT' . > log
# pgcvslog -r '\.2\.[0-9]*$' log
#
# pre and post-branch logs:
# cvs log -d'2000-05-08 00:00:00 GMT<2000-05-29 00:00:00 GMT'
# cvs log -d'>2000-05-29 00:00:00 GMT' -rREL7_0_PATCHES
#
if [ "X$1" = "X-r" ]
then REV="$2"
shift 2
else REV=".*"
fi
# pgcvslog -r '\.2\.[0-9]*$' log
cat "$@" |
@ -21,8 +22,6 @@ cat "$@" |
awk '
$0 ~ /^Working file:/ {workingfile = $0}
$1 == "revision" && $2 !~ /'"$REV"'/ {skip = "Y"}
($0 ~ /^====*$/ || $0 ~ /^----*$/) && skip == "N" \
{
/* print blank line separating entries */