Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 56d982b

Browse files
committed
Mention ALTER COLUMN TYPE in FAQ.
1 parent 5be1e13 commit 56d982b

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

doc/FAQ

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Frequently Asked Questions (FAQ) for PostgreSQL
33

4-
Last updated: Sun Jan 16 21:40:18 EST 2005
4+
Last updated: Sun Jan 16 22:01:06 EST 2005
55

66
Current maintainer: Bruce Momjian (pgman@candle.pha.pa.us)
77

@@ -690,7 +690,10 @@ log_*
690690
ALTER TABLE new_table RENAME TO old_table;
691691
COMMIT;
692692

693-
To change the data type of a column, do this:
693+
Changing the data type of a column can be done easily in 8.0 and later
694+
with ALTER TABLE ALTER COLUMN TYPE.
695+
696+
In earlier releases, do this:
694697
BEGIN;
695698
ALTER TABLE tab ADD COLUMN new_col new_data_type;
696699
UPDATE tab SET new_col = CAST(old_col AS new_data_type);

doc/src/FAQ/FAQ.html

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
alink="#0000ff">
1111
<H1>Frequently Asked Questions (FAQ) for PostgreSQL</H1>
1212

13-
<P>Last updated: Sun Jan 16 21:40:18 EST 2005</P>
13+
<P>Last updated: Sun Jan 16 22:01:06 EST 2005</P>
1414

1515
<P>Current maintainer: Bruce Momjian (<A href=
1616
"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,
854854
<H4><A name="4.4">4.4</A>) How do you remove a column from a
855855
table, or change its data type?</H4>
856856

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,
859859
you can do this:</P>
860860
<PRE>
861861
BEGIN;
@@ -868,7 +868,10 @@ <H4><A name="4.4">4.4</A>) How do you remove a column from a
868868
COMMIT;
869869
</PRE>
870870

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>
872875
<PRE>
873876
BEGIN;
874877
ALTER TABLE tab ADD COLUMN new_col <i>new_data_type</i>;

0 commit comments

Comments
 (0)