10
10
alink ="#0000ff ">
11
11
< H1 > Frequently Asked Questions (FAQ) for PostgreSQL</ H1 >
12
12
13
- < P > Last updated: Sun Jan 1621:40:18 EST 2005</ P >
13
+ < P > Last updated: Sun Jan 1622:01:06 EST 2005</ P >
14
14
15
15
< P > Current maintainer: Bruce Momjian (< A href =
16
16
"mailto:pgman@candle.pha.pa.us "> pgman@candle.pha.pa.us</ A > )< BR >
@@ -854,8 +854,8 @@ <H4><A name="4.3">4.3</A>) How do I find out what tables, indexes,
854
854
< H4 > < A name ="4.4 "> 4.4</ A > ) How do you remove a column from a
855
855
table, or change its data type?</ H4 >
856
856
857
- < P > < SMALL > DROP COLUMN</ SMALL > functionality was added in release 7.3 with
858
- < SMALL > ALTER TABLE DROP COLUMN</ SMALL > . In earlier versions,
857
+ < P > < SMALL > DROP COLUMN</ SMALL > functionality was added in release 7.3
858
+ with < SMALL > ALTER TABLE DROP COLUMN</ SMALL > . In earlier versions,
859
859
you can do this:</ P >
860
860
< PRE >
861
861
BEGIN;
@@ -868,7 +868,10 @@ <H4><A name="4.4">4.4</A>) How do you remove a column from a
868
868
COMMIT;
869
869
</ PRE >
870
870
871
- < P > To change the data type of a column, do this:</ P >
871
+ < P > Changing the data type of a column can be done easily in 8.0
872
+ and later with< SMALL > ALTER TABLE ALTER COLUMN TYPE</ SMALL > .
873
+
874
+ < P > In earlier releases, do this:</ P >
872
875
< PRE >
873
876
BEGIN;
874
877
ALTER TABLE tab ADD COLUMN new_col< i > new_data_type</ i > ;