File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 1
1
2
2
Frequently Asked Questions (FAQ) for PostgreSQL
3
3
4
- Last updated: Thu Apr 18 00:44:51 EDT 2002
4
+ Last updated: Fri Apr 26 23:03:46 EDT 2002
5
5
6
6
Current maintainer: Bruce Momjian (pgman@candle.pha.pa.us)
7
7
637
637
4.4) How do you remove a column from a table?
638
638
639
639
We do not support ALTER TABLE DROP COLUMN, but do this:
640
+ BEGIN;
641
+ LOCK TABLE old_table;
640
642
SELECT ... -- select all columns but the one you want to remove
641
643
INTO TABLE new_table
642
644
FROM old_table;
643
645
DROP TABLE old_table;
644
646
ALTER TABLE new_table RENAME TO old_table;
647
+ COMMIT;
645
648
646
649
4.5) What is the maximum size for a row, a table, and a database?
647
650
Original file line number Diff line number Diff line change 14
14
alink ="#0000ff ">
15
15
< H1 > Frequently Asked Questions (FAQ) for PostgreSQL</ H1 >
16
16
17
- < P > Last updated: Thu Apr 18 00:44:51 EDT 2002</ P >
17
+ < P > Last updated: Fri Apr 26 23:03:46 EDT 2002</ P >
18
18
19
19
< P > Current maintainer: Bruce Momjian (< A href =
20
20
"mailto:pgman@candle.pha.pa.us "> pgman@candle.pha.pa.us</ A > )< BR >
@@ -827,11 +827,14 @@ <H4><A name="4.4">4.4</A>) How do you remove a column from a
827
827
< P > We do not support < SMALL > ALTER TABLE DROP COLUMN,</ SMALL > but do
828
828
this:</ P >
829
829
< PRE >
830
+ BEGIN;
831
+ LOCK TABLE old_table;
830
832
SELECT ... -- select all columns but the one you want to remove
831
833
INTO TABLE new_table
832
834
FROM old_table;
833
835
DROP TABLE old_table;
834
836
ALTER TABLE new_table RENAME TO old_table;
837
+ COMMIT;
835
838
</ PRE >
836
839
837
840
< H4 > < A name ="4.5 "> 4.5</ A > ) What is the maximum size for a row, a
You can’t perform that action at this time.
0 commit comments