From 0b79ed27457bda0f2545257225923488ca72a453 Mon Sep 17 00:00:00 2001
From: Bruce Momjian Last updated: Wed Dec 5 00:41:12 EST 2001 Last updated: Fri Jan 4 00:44:42 EST 2002 Current maintainer: Bruce Momjian (pgman@candle.pha.pa.us) Check your locale configuration. PostgreSQL uses the locale
- setting of 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. See the DECLARE manual page for a
description. See the FETCH manual page, or use
@@ -816,7 +805,7 @@
records requested, or the entire query may have to be evaluated
until the desired rows have been generated.Frequently Asked Questions (FAQ) for PostgreSQL
-
@@ -89,57 +89,55 @@
Operational Questions
- 4.2) What is the exact difference between
+ 4.1) What is the difference between
binary cursors and normal cursors?
- 4.3) How do I SELECT only the
+ 4.2) How do I SELECT only the
first few rows of a query?
- 4.4) How do I get a list of tables or other
+ 4.3) How do I get a list of tables or other
things I can see in psql?
- 4.5) How do you remove a column from a
+ 4.4) How do you remove a column from a
table?
- 4.6) What is the maximum size for a row, table,
+ 4.5) What is the maximum size for a row, table,
database?
- 4.7) How much database disk space is required
+ 4.6) How much database disk space is required
to store data from a typical text file?
- 4.8) How do I find out what tables or indexes
+ 4.7) How do I find out what tables or indexes
are defined in the database?
- 4.9) My queries are slow or don't make use of
+ 4.8) My queries are slow or don't make use of
the indexes. Why?
- 4.10) How do I see how the query optimizer is
+ 4.9) How do I see how the query optimizer is
evaluating my query?
- 4.11) What is an R-tree index?
- 4.12) What is the Genetic Query Optimizer?
- 4.13) How do I perform regular expression
+ 4.10) What is an R-tree index?
+ 4.11) What is the Genetic Query Optimizer?
+ 4.12) How do I perform regular expression
searches and case-insensitive regular expression searches? How do I
use an index for case-insensitive searches?
- 4.14) In a query, how do I detect if a field
+ 4.13) In a query, how do I detect if a field
is NULL?
- 4.15) What is the difference between the
+ 4.14) What is the difference between the
various character types?
- 4.16.1) How do I create a
+ 4.15.1) How do I create a
serial/auto-incrementing field?
- 4.16.2) How do I get the value of a
+ 4.15.2) How do I get the value of a
SERIAL insert?
- 4.16.3) Don't currval() and
+ 4.15.3) Don't currval() and
nextval() lead to a race condition with other users?
- 4.17) What is an OID? What is a
+ 4.16) What is an OID? What is a
TID?
- 4.18) What is the meaning of some of the terms
+ 4.17) What is the meaning of some of the terms
used in PostgreSQL?
- 4.19) Why do I get the error "ERROR:
+ 4.18) Why do I get the error "ERROR:
Memory exhausted in AllocSetAlloc()?"
- 4.20) How do I tell what PostgreSQL version I
+ 4.19) How do I tell what PostgreSQL version I
am running?
- 4.21) My large-object operations get
+ 4.20) My large-object operations get
invalid large obj descriptor. Why?
- 4.22) How do I create a column that will
+ 4.21) How do I create a column that will
default to the current time?
- 4.23) Why are my subqueries using
+ 4.22) Why are my subqueries using
IN so slow?
- 4.24) How do I perform an outer join?
- 4.25) How do I perform queries using multiple databases?
+ 4.23) How do I perform an outer join?
+ 4.24) How do I perform queries using multiple databases?
Operational Questions
4.1) Why is system confused about commas,
- decimal points, and date formats.
-
- 4.2) What is the exact difference between
+
4.1) What is the difference between
binary cursors and normal cursors?
4.3) How do I SELECT only the
+
4.2) How do I SELECT only the
first few rows of a query?
4.4) How do I get a list of tables or other
+
4.3) How do I get a list of tables or other
things I can see in psql?
@@ -827,7 +816,7 @@
-E option so it will print out the queries it uses to
execute the commands you give.
We do not support ALTER TABLE DROP COLUMN, but do @@ -840,7 +829,7 @@ ALTER TABLE new_table RENAME TO old_table; -
These are the limits:
@@ -864,7 +853,7 @@The maximum table size and maximum number of columns can be increased if the default block size is increased to 32k.
-Indexes do not require as much overhead, but do contain the data that is being indexed, so they can be large also.
-psql has a variety of backslash commands to show such @@ -907,7 +896,7 @@ illustrates many of the SELECTs needed to get information from the database system tables.
-PostgreSQL does not automatically maintain statistics. @@ -937,12 +926,12 @@ ~(regular expression searches) should start with ^.
-See the EXPLAIN manual page.
-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 @@ -967,7 +956,7 @@ practice, extending R-trees requires a bit of work and we don't currently have any documentation on how to do it.
-The GEQO module speeds query optimization when @@ -975,7 +964,7 @@ the handling of large join queries through nonexhaustive search.
-You test the column with IS NULLIS NOT NULL.
-
Type Internal Name Notes
@@ -1034,7 +1023,7 @@ BYTEA bytea variable-length byte array (null-safe)
binary data, particularly values that include NULL
bytes.
- 4.16.1) How do I create a
+ 4.15.1) How do I create a
serial/auto-incrementing field?
PostgreSQL supports a SERIAL data type. It
@@ -1064,13 +1053,13 @@ BYTEA bytea variable-length byte array (null-safe)
- 4.16.2) How do I get the value of a
+ 4.15.2) How do I get the value of a
SERIAL insert?
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
+ example table in 4.15.1, that might look like
this in Perl:
new_id = output of "SELECT nextval('person_id_seq')"
@@ -1091,20 +1080,20 @@ BYTEA bytea variable-length byte array (null-safe)
INSERT INTO person (name) VALUES ('Blaise Pascal');
new_id = output of "SELECT currval('person_id_seq')";
- Finally, you could use the OID
+ Finally, you could use the OID
returned from the INSERT statement to look up 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
+ 4.15.3) Don't currval() and
nextval() lead to a race condition with other users?
No. Currval() returns the current value assigned by your
backend, not by all users.
- 4.17) What is an OID? What is
+ 4.16) What is an OID? What is
a TID?
OIDs are PostgreSQL's answer to unique row ids.
@@ -1149,7 +1138,7 @@ BYTEA bytea variable-length byte array (null-safe)
or reloaded. They are used by index entries to point to physical
rows.
- 4.18) What is the meaning of some of the
+ 4.17) What is the meaning of some of the
terms used in PostgreSQL?
Some of the source code and older documentation use terms that
@@ -1178,7 +1167,7 @@ BYTEA bytea variable-length byte array (null-safe)
A list of general database terms can be found at: http://www.comptechnews.com/~reaster/dbdesign.html
- 4.19) Why do I get the error "ERROR:
+ 4.18) Why do I get the error "ERROR:
Memory exhausted in AllocSetAlloc()?"
@@ -1198,13 +1187,13 @@ BYTEA bytea variable-length byte array (null-safe)
backend is returning too much data, try it before starting the
client.
- 4.20) How do I tell what PostgreSQL version
+ 4.19) How do I tell what PostgreSQL version
I am running?
From psql, type select version();
- 4.21) My large-object operations get
+ 4.20) My large-object operations get
invalid large obj descriptor. Why?
@@ -1221,7 +1210,7 @@ BYTEA bytea variable-length byte array (null-safe)
If you are using a client interface like ODBC you
may need to set auto-commit off.
- 4.22) How do I create a column that will
+ 4.21) How do I create a column that will
default to the current time?
@@ -1231,7 +1220,7 @@ BYTEA bytea variable-length byte array (null-safe)
- IN so slow?PostgreSQL 7.1 and later supports outer joins using the SQL @@ -1295,7 +1284,7 @@ BYTEA bytea variable-length byte array (null-safe) ORDER BY col1 -
There is no way to query any database except the current one. -- cgit v1.2.3