From 79b0da6e7c7f2dba1b07d80e8fb45de2c376ca53 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Wed, 23 Jul 2003 04:13:13 +0000 Subject: Update all FAQ's for 7.3.4. --- doc/src/FAQ/FAQ.html | 90 ++++++++++++++++++++++++++++++++++------------------ 1 file changed, 60 insertions(+), 30 deletions(-) (limited to 'doc/src/FAQ/FAQ.html') diff --git a/doc/src/FAQ/FAQ.html b/doc/src/FAQ/FAQ.html index 0e7a601a243..54fc1b724f9 100644 --- a/doc/src/FAQ/FAQ.html +++ b/doc/src/FAQ/FAQ.html @@ -10,7 +10,7 @@ alink="#0000ff">

Frequently Asked Questions (FAQ) for PostgreSQL

-

Last updated: Fri Feb 14 09:03:00 EST 2003

+

Last updated: Wed Jul 23 00:11:07 EDT 2003

Current maintainer: Bruce Momjian (pgman@candle.pha.pa.us)
@@ -18,10 +18,10 @@

The most recent version of this document can be viewed at http://www.ca.PostgreSQL.org/docs/faq-english.html.

+ "http://www.PostgreSQL.org/docs/faqs/FAQ.html">http://www.PostgreSQL.org/docs/faqs/FAQ.html.

Platform-specific questions are answered at http://www.ca.PostgreSQL.org/users-lounge/docs/faq.html.

+ "http://www.PostgreSQL.org/docs/index.html">http://www.PostgreSQL.org/docs/index.html.


General Questions

@@ -83,11 +83,11 @@ 4.1) What is the difference between binary cursors and normal cursors?
4.2) How do I SELECT only the - first few rows of a query?
+ first few rows of a query? A random row?
4.3) How do I get a list of tables or other things I can see in psql?
4.4) How do you remove a column from a - table?
+ table, or change it's data type?
4.5) What is the maximum size for a row, a table, and a database?
4.6) How much database disk space is required @@ -245,11 +245,16 @@

The database server can run on Windows NT and Win2k using Cygwin, the Cygnus Unix/NT porting library. See pgsql/doc/FAQ_MSWIN in the distribution or the MS Windows FAQ - at - http://www.PostgreSQL.org/docs/faq-mswin.html.

+ at + http://www.PostgreSQL.org/docs/faqs/text/FAQ_MSWIN.

A native port to MS Win NT/2000/XP is currently being worked - on.

+ on. For more details on the current status of PostgreSQL on Windows see + + http://techdocs.postgresql.org/guides/Windows.

+ +

There is also a Novell Netware 6 port at + http://forge.novell.com.

1.5) Where can I get PostgreSQL?

@@ -309,12 +314,12 @@ http://www.PostgreSQL.org -

There is also an IRC channel on EFNet, channel - #PostgreSQL. I use the Unix command irc -c +

There is also an IRC channel on EFNet and OpenProjects, + channel #PostgreSQL. I use the Unix command irc -c '#PostgreSQL' "$USER" irc.phoenix.net.

A list of commercial support companies is available at http://www.ca.PostgreSQL.org/users-lounge/commercial-support.html.

+ "http://techdocs.postgresql.org/companies.php">http://techdocs.postgresql.org/companies.php.

1.7) What is the latest release?

@@ -326,8 +331,8 @@

Several manuals, manual pages, and some small test examples are included in the distribution. See the /doc directory. You - can also browse the manual online at http://www.ca.PostgreSQL.org/users-lounge/docs/.

+ can also browse the manuals online at http://www.PostgreSQL.org/docs.

There are two PostgreSQL books available online at http://www.PostgreSQL.org/docs/awbook.html @@ -335,7 +340,7 @@ "http://www.commandprompt.com/ppbook/">http://www.commandprompt.com/ppbook/. There is a list of PostgreSQL books available for purchase at http://www.ca.PostgreSQL.org/books/. + "http://techdocs.postgresql.org/techdocs/bookreviews.php">http://techdocs.PostgreSQL.org/techdocs/bookreviews.php. There is also a collection of PostgreSQL technical articles at http://techdocs.PostgreSQL.org/.

@@ -498,6 +503,11 @@ send a check to the contact address.


+

Also, if you have a success story about PostgreSQL, please submit + it to our advocacy site at + http://advocacy.postgresql.org.

+ +

User Client Questions

2.1) Are there ODBC drivers @@ -535,7 +545,7 @@

2.3) Does PostgreSQL have a graphical user interface?

- Yes, there are several graphical interfaces to PostgreSQL available. +

Yes, there are several graphical interfaces to PostgreSQL available. These include PgAccess http://www.pgaccess.org), PgAdmin II (http://www.pgadmin.org, @@ -545,7 +555,9 @@ http://www.thekompany.com/products/rekall/, proprietary). There is also PHPPgAdmin ( http://phppgadmin.sourceforge.net/ ), a web-based interface to - PostgreSQL. + PostgreSQL.

+ +

See http://techdocs.postgresql.org/guides/GUITools for a more detailed list.

2.4) What languages are able to communicate with PostgreSQL?

@@ -600,7 +612,7 @@ postmaster. For most systems, with default numbers of buffers and processes, you need a minimum of ~1 MB. See the PostgreSQL + "http://www.PostgreSQL.org/docs/view.php?version=current&idoc=1&file=kernel-resources.html">PostgreSQL Administrator's Guide for more detailed information about shared memory and semaphores.

@@ -792,7 +804,7 @@ description.

4.2) How do I SELECT only the - first few rows of a query?

+ first few rows of a query? A random row?

See the FETCH manual page, or use SELECT ... LIMIT....

@@ -804,6 +816,14 @@ records requested, or the entire query may have to be evaluated until the desired rows have been generated.

+

To SELECT a random row, use: +

+    SELECT col
+    FROM tab
+    ORDER BY random()
+    LIMIT 1;
+
+

4.3) How do I get a list of tables or other things I can see in psql?

@@ -815,9 +835,9 @@ execute the commands you give.

4.4) How do you remove a column from a - table?

+ table, or change its data type? -

This functionality was added in release 7.3 with +

DROP COLUMN functionality was added in release 7.3 with ALTER TABLE DROP COLUMN. In earlier versions, you can do this:

@@ -831,12 +851,23 @@
     COMMIT;
 
+

To change the data type of a column, do this:

+
+    BEGIN;
+    ALTER TABLE tab ADD COLUMN new_col new_data_type;
+    UPDATE tab SET new_col = CAST(old_col AS new_data_type);
+    ALTER TABLE tab DROP COLUMN old_col;
+    COMMIT;
+
+

You might then want to do VACUUM FULL tab to reclaim the + disk space used by the expired rows.

+

4.5) What is the maximum size for a row, a table, and a database?

These are the limits:

-    Maximum size for a database?             unlimited (1 TB databases exist)
+    Maximum size for a database?             unlimited (4 TB databases exist)
     Maximum size for a table?                16 TB
     Maximum size for a row?                  1.6TB
     Maximum size for a field?                1 GB
@@ -1037,14 +1068,14 @@ Type            Internal Name   Notes
 VARCHAR(n)      varchar         size specifies maximum length, no padding
 CHAR(n)         bpchar          blank padded to the specified fixed length
 TEXT            text            no specific upper limit on length
-"char"          char            one character
 BYTEA           bytea           variable-length byte array (null-byte safe)
+"char"          char            one character
 

You will see the internal name when examining system catalogs and in some error messages.

-

The last four types above are "varlena" types (i.e., the first +

The first four types above are "varlena" types (i.e., the first four bytes on disk are the length, followed by the data). Thus the actual space used is slightly greater than the declared size. However, these data types are also subject to compression or being @@ -1058,8 +1089,8 @@ BYTEA bytea variable-length byte array (null-byte safe) same length. CHAR(n) pads with blanks to the specified length, while VARCHAR(n) only stores the characters supplied. BYTEA is for storing binary data, - particularly values that include NULL bytes. These - types have similar performance characteristics.

+ particularly values that include NULL bytes. All the + types described here have similar performance characteristics.

4.15.1) How do I create a serial/auto-incrementing field?

@@ -1340,11 +1371,10 @@ BYTEA bytea variable-length byte array (null-byte safe)

4.25) How do I return multiple rows or columns from a function?

-

You can return result sets from PL/pgSQL functions using - refcursors. See - http://www.PostgreSQL.org/idocs/index.php?plpgsql-cursors.html, - section 23.7.3.3.

+

In 7.3, you can easily return multiple rows or columns from a + function, + + http://techdocs.postgresql.org/guides/SetReturningFunctions.

4.26) Why can't I reliably create/drop temporary tables in PL/PgSQL functions?

-- cgit v1.2.3