Update DROP COLUMN example to use transactions and rollback-able DROP TABLE>
authorBruce Momjian
Sat, 27 Apr 2002 03:04:08 +0000 (03:04 +0000)
committerBruce Momjian
Sat, 27 Apr 2002 03:04:08 +0000 (03:04 +0000)
doc/FAQ
doc/src/FAQ/FAQ.html

diff --git a/doc/FAQ b/doc/FAQ
index 791cfbd9d3735b0e7ac075322e2fc66c32395632..2c4193a833d53f00823e4312155b78d3c7390760 100644 (file)
--- a/doc/FAQ
+++ b/doc/FAQ
@@ -1,7 +1,7 @@
 
                 Frequently Asked Questions (FAQ) for PostgreSQL
                                        
-   Last updated: Thu Apr 18 00:44:51 EDT 2002
+   Last updated: Fri Apr 26 23:03:46 EDT 2002
    
    Current maintainer: Bruce Momjian ([email protected])
    
     4.4) How do you remove a column from a table?
     
    We do not support ALTER TABLE DROP COLUMN, but do this:
+    BEGIN;
+    LOCK TABLE old_table;
     SELECT ...  -- select all columns but the one you want to remove
     INTO TABLE new_table
     FROM old_table;
     DROP TABLE old_table;
     ALTER TABLE new_table RENAME TO old_table;
+    COMMIT;
 
     4.5) What is the maximum size for a row, a table, and a database?
     
index 8f0dbb11bbc828661f539987ef0b40b7338b0af3..988aa3f968f7ca070b6460cc854636afd8641d5b 100644 (file)
@@ -14,7 +14,7 @@
   alink="#0000ff">
     

Frequently Asked Questions (FAQ) for PostgreSQL

 
-    

Last updated: Thu Apr 18 00:44:51 EDT 2002

+    

Last updated: Fri Apr 26 23:03:46 EDT 2002

 
     

Current maintainer: Bruce Momjian (

     

We do not support ALTER TABLE DROP COLUMN, but do

     this:

 
+    BEGIN;
+    LOCK TABLE old_table;
     SELECT ...  -- select all columns but the one you want to remove
     INTO TABLE new_table
     FROM old_table;
     DROP TABLE old_table;
     ALTER TABLE new_table RENAME TO old_table;
+    COMMIT;
 
 
     

4.5) What is the maximum size for a row, a