HREF="http://www.PostgreSQL.org/docs/postgres">
http://www.PostgreSQL.org/docs/postgres.
PostgreSQL supports an extended subset of SQL-92. See our
-TODO
for a list of known bugs, missing features, and future plans.
+TODO
list for known bugs, missing features, and future plans.
1.10) How can I learn SQL?
1.12) How do I join the development team?
-First, download the latest sources and read the PostgreSQL Developers
+First, download the latest source and read the PostgreSQL Developers
documentation on our web site, or in the distribution.
-Second, subscribe to the pgsql-hackers and pgsql-patches mailing lists.
+Second, subscribe to the pgsql-hackers and pgsql-patches mailing lists.
Third, submit high-quality patches to pgsql-patches.
There are about a dozen people who have commit privileges to
the PostgreSQL CVS archive. They each have submitted so many
-high-quality patches that it was a pain for the existing
+high-quality patches that it was impossible for the existing
committers to keep up, and we had confidence that patches they
-committed were likely to be of high quality.
+committed were of high quality.
1.13) How do I submit a bug report?
integrity, and sophisticated locking. We have some features they don't
have, like user-defined types, inheritance, rules, and multi-version
concurrency control to reduce lock contention. We don't have outer
-joins, but are working on them for our next release.
+joins, but are working on them.
Performance
Python(PyGreSQL)
TCL(libpgtcl)
C Easy API(libpgeasy)
3.2) How do I install PostgreSQL somewhere
-other than
/usr/local/pgsql?
+other than
/usr/local/pgsql?
-The simplest way is to specify the --prefix option when running configure.
-If you forgot to do that, you can edit Makefile.global and change POSTGRESDIR
-accordingly, or create a
Makefile.custom and define POSTGRESDIR there.
+The simplest way is to specify the --prefix option when running configure.
+If you forgot to do that, you can edit Makefile.global and change POSTGRESDIR
+accordingly, or create a
Makefile.custom and define POSTGRESDIR there.
-
3.3) When I start the postmaster, I get a Bad
+
3.3) When I start the postmaster, I get a Bad
System Call or core dumped message. Why?
It could be a variety of problems, but first check to see that you
kernel support for shared memory and semaphores.
-
3.4) When I try to start the postmaster, I
+
3.4) When I try to start the postmaster, I
get
IpcMemoryCreate errors. Why?
You either do not have shared memory configured properly in your kernel or
you need to enlarge the shared memory available in the kernel. The
exact amount you need depends on your architecture and how many buffers
-and backend processes you configure postmaster to run with.
+and backend processes you configure for the postmaster.
For most systems, with default numbers of buffers and processes, you
-
3.5) When I try to start the postmaster, I
+
3.5) When I try to start the postmaster, I
get
IpcSemaphoreCreate errors. Why?
If the error message is IpcSemaphoreCreate: semget failed (No space
left on device) then your kernel is not configured with enough
semaphores. Postgres needs one semaphore per potential backend process.
-A temporary solution is to start the postmaster with a smaller limit on
+A temporary solution is to start the postmaster with a smaller limit on
the number of backend processes. Use -N with a parameter less
than the default of 32. A more permanent solution is to increase your
kernel's
SEMMNS and
SEMMNI parameters.
The default configuration allows only unix domain socket connections
from the local machine. To enable TCP/IP connections, make sure the
-postmaster has been started with the -i option, and add an
+postmaster has been started with the -i option, and add an
appropriate host entry to the file
pgsql/data/pg_hba.conf.
You should not create database users with user id 0 (root). They will be
-unable to access the database. This is a security precaution because
-of the ability of any user to dynamically link object modules into the
+unable to access the database. This is a security precaution because
+of the ability of users to dynamically link object modules into the
consider dropping and recreating indices when making large data
-There are several tuning things that can be done. You can disable
-fsync() by starting the postmaster with a -o -F option. This will
-prevent
fsync()'s from flushing to disk after every transaction.
+There are several tuning options. You can disable
+fsync() by starting the postmaster with a -o -F
+option. This will prevent fsync()'s from flushing to disk after
-You can also use the postmaster -B option to increase the number of
+You can also use the postmaster -B option to increase the number of
shared memory buffers used by the backend processes. If you make this
-parameter too high, the postmaster may not start because you've exceeded
+parameter too high, the postmaster may not start because you've exceeded
your kernel's limit on shared memory space.
Each buffer is 8K and the default is 64 buffers.
-You can also use the backend -S option to increase the maximum amount
-of memory used by the backend process for temporary sorts. The -S value
+You can also use the backend -S option to increase the maximum amount
+of memory used by the backend process for temporary sorts. The -S value
is measured in kilobytes, and the default is 512 (ie, 512K).
You can also use the CLUSTER command to group data in tables to
-match an index. See the
cluster(l) manual page for more details.
+match an index. See the
CLUSTER manual page for more details.
3.11) What debugging features are available?
PostgreSQL has several features that report status information that can
be valuable for debugging purposes.
-First, by running configure with the --enable-cassert option, many
+First, by running configure with the --enable-cassert option, many
assert()'s monitor the progress of the backend and halt the program when
something unexpected occurs.
This will put a server.log file in the top-level PostgreSQL directory.
This file contains useful information about problems or errors
-encountered by the server. Postmaster has a -d option that allows even
+encountered by the server. Postmaster has a -d option that allows even
more detailed information to be reported. The -d option takes a number
that specifies the debug level. Be warned that high debug level values
generate large log files.
3.12) I get 'Sorry, too many clients' when trying
-You need to increase the postmaster's limit on how many concurrent backend
+You need to increase the postmaster's limit on how many concurrent backend
In PostgreSQL 6.5 and up, the default limit is 32 processes. You can
-increase it by restarting the postmaster with a suitable -N
+increase it by restarting the postmaster with a suitable -N
value. With the default configuration you can set -N as large as
1024. If you need more, increase MAXBACKENDS in
include/config.h and rebuild. You can set the default value of
--N at configuration time, if you like, using configure's
+-N at configuration time, if you like, using configure's
--with-maxbackends switch.
Note that if you make -N larger than 32, you must also increase
--B beyond its default of 64; -B must be at least twice -N, and
+-B beyond its default of 64; -B must be at least twice -N, and
probably should be more than that for best performance. For large
numbers of backend processes, you are also likely to find that you need
to increase various Unix kernel configuration parameters. Things to
They are temporary files generated by the query executor. For
example, if a sort needs to be done to satisfy an ORDER BY, and
the sort requires more space than the backend's -S parameter allows,
-then temp files are created to hold the extra data.
+then temp
orary files are created to hold the extra data.
The temp files should be deleted automatically, but might not if a backend
crashes during a sort. If you have no backends running at the time,
commas, decimal points, and date formats.
Check your locale configuration. PostgreSQL uses the locale setting of
-the user that ran the postmaster process. There are postgres and psql
+the user that ran the postmaster process. There are postgres and psql
SET commands to control the date format. Set those accordingly for
your operating environment.
BLCKSZ. To use attributes larger than 8K, you can also
use the large object interface.
-
Row length limit will be removed in 7.1.
+
The row length limit will be removed in 7.1.
4.7)How much database disk space is required to
See the create_sequence manual page for more information about sequences.
-You can also use each row's oid field as a unique value. However, if
+You can also use each row's OID field as a unique value. However, if
you need to dump and reload the database, you need to use pg_dump's -o
-option or
COPY WITH OIDS option to preserve the
oids.
+option or
COPY WITH OIDS option to preserve the
OIDs.
-
4.16.2) How do I get the back the generated SERIAL value after an insert?
+
4.16.2) How do I get the value of a
One approach is to to retrieve the next SERIAL value from the sequence object with the
nextval() function
before inserting and then insert it explicitly. Using the example table in
4.16.1, that might look like this:
$newSerialID = nextval('person_id_seq');
INSERT INTO person (name) VALUES ('Blaise Pascal');
$newID = currval('person_id_seq');
-Finally, you could use the
oid returned from the
+Finally, you could use the
OID 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().
-
4.16.3) Don't currval() and nextval() lead to a race condition with other
-
concurrent backend processes?
+
4.16.3) Don't currval() and nextval() lead to
+
a race condition with other users?
No. This is handled by the backends.
-
4.17) What is an oid? What is a tid?
+
4.17) What is an OID? What is a
OIDs are PostgreSQL's answer to unique row ids. Every row that is
-created in PostgreSQL gets a unique oid. All oids generated during
+created in PostgreSQL gets a unique OID. All OIDs generated during
initdb are less than 16384 (from backend/access/transam.h). All
-user-created oids are equal or greater that this. By default, all these
-oids are unique not only within a table, or database, but unique within
+user-created OIDs are equal or greater that this. By default, all these
+OIDs are unique not only within a table, or database, but unique within
the entire PostgreSQL installation.
-PostgreSQL uses oids in its internal system tables to link rows between
-tables. These oids can be used to identify specific user rows and used
-in joins. It is recommended you use column type oid to store oid
-values. You can create an index on the
oid field for faster access.
+PostgreSQL uses OIDs in its internal system tables to link rows between
+tables. These OIDs can be used to identify specific user rows and used
+in joins. It is recommended you use column type OID to
+store OID
+values. You can create an index on the
OID field for faster access.
-Oids are assigned to all new rows from a central area that is used by
-all databases. If you want to change the oid to something else, or if
-you want to make a copy of the table, with the original oid's, there is
+Oids are assigned to all new rows from a central area that is used by
+all databases. If you want to change the OID to something else, or if
+you want to make a copy of the table, with the original OID's, there is
no reason you can't do it:
-->
-Tids are used to identify specific physical rows with block and offset
+TIDs are used to identify specific physical rows with block and offset
values. Tids change after rows are modified or reloaded. They are used
by index entries to point to physical rows.
retrieve, select
replace, update
append, insert
-
oid, serial value
+
OID, serial value
portal, cursor
range variable, table name, table alias
-
4.19) Why do I get the error "FATAL: palloc
-failure: memory exhausted?"
+
4.19) Why do I get the error "FATAL: palloc
+failure: memory exhausted?"<
/I><BR>
It is possible you have run out of virtual memory on your system, or
your kernel has a low limit for certain resources. Try this before
-starting the postmaster:
+starting the postmaster:
ulimit -d 65536
CREATE TABLE test (x int, modtime timestamp default now() );
-
4.23) Why are my subqueries using IN
so
+
4.23) Why are my subqueries using
Currently, we join subqueries to outer queries by sequential scanning
the result of the subquery for each row of the outer query. A workaround
-is to replace IN
with EXISTS
. For example,
-change:
+is to replace IN
with EXISTS
:
SELECT *
FROM tab
The problem could be a number of things. Try testing your user-defined
function in a stand alone test program first.
-
5.2) What does the message:
-
NOTICE:PortalHeapMemoryFree: 0x402251d0 not in alloc set! mean?
+
5.2) What does the message
+
"NOTICE:PortalHeapMemoryFree: 0x402251d0 not in alloc set!" mean?
You are pfree'ing something that was not palloc'ed.
Beware of mixing malloc/free and palloc/pfree.
tried it, though in principle it can be done.
5.5) I have changed a source file. Why does the
-recompile
does not see the change?
+recompile not see the change?
-The Makefiles do not have the proper dependencies for include files. You
-have to do a make clean and then another make.
- You
-have to do a
make clean and then another
make.
+The Makefiles do not have the proper dependencies for include files. You
+have to do a
make clean and then another
make.