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

Commit 2ccf79a

Browse files
committed
Remove FAQ mention of DROP column.
1 parent 25deba3 commit 2ccf79a

File tree

2 files changed

+12
-35
lines changed

2 files changed

+12
-35
lines changed

doc/FAQ

+6-15
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Frequently Asked Questions (FAQ) for PostgreSQL
33

4-
Last updated: Mon Jan 31 20:35:58 EST 2005
4+
Last updated: Mon Jan 31 20:41:21 EST 2005
55

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

@@ -51,7 +51,7 @@
5151
4.1) How do I SELECT only the first few rows of a query? A random row?
5252
4.2) How do I find out what tables, indexes, databases, and users are
5353
defined? How do I see the queries used by psql to display them?
54-
4.3) How do you remove a column from a table, or change its data type?
54+
4.3) How do you change a column's data type?
5555
4.4) What is the maximum size for a row, a table, and a database?
5656
4.5) How much database disk space is required to store data from a
5757
typical text file?
@@ -491,25 +491,16 @@
491491
query to get information about the database.
492492

493493
There are also system tables beginning with pg_ that describe these
494-
too. Use psql -l will list all databases.
494+
too.
495+
496+
Use psql -l will list all databases.
495497

496498
Also try the file pgsql/src/tutorial/syscat.source. It illustrates
497499
many of the SELECTs needed to get information from the database system
498500
tables.
499501

500-
4.3) How do you remove a column from a table, or change its data type?
502+
4.3) How do you change a column's data type?
501503

502-
DROP COLUMN functionality was added in release 7.3 with ALTER TABLE
503-
DROP COLUMN. In earlier versions, you can do this:
504-
BEGIN;
505-
LOCK TABLE old_table;
506-
SELECT ... -- select all columns but the one you want to remove
507-
INTO TABLE new_table
508-
FROM old_table;
509-
DROP TABLE old_table;
510-
ALTER TABLE new_table RENAME TO old_table;
511-
COMMIT;
512-
513504
Changing the data type of a column can be done easily in 8.0 and later
514505
with ALTER TABLE ALTER COLUMN TYPE.
515506

doc/src/FAQ/FAQ.html

+6-20
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: Mon Jan 31 20:35:58 EST 2005</P>
13+
<P>Last updated: Mon Jan 31 20:41:21 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>)
@@ -74,8 +74,7 @@ <H2 align="center">Operational Questions</H2>
7474
<A href="#4.2">4.2</A>) How do I find out what tables, indexes,
7575
databases, and users are defined? How do I see the queries used
7676
by <I>psql</I> to display them?<BR>
77-
<A href="#4.3">4.3</A>) How do you remove a column from a
78-
table, or change its data type?<BR>
77+
<A href="#4.3">4.3</A>) How do you change a column's data type?<BR>
7978
<A href="#4.4">4.4</A>) What is the maximum size for a row, a
8079
table, and a database?<BR>
8180
<A href="#4.5">4.5</A>) How much database disk space is required
@@ -645,28 +644,15 @@ <H4><A name="4.2">4.2</A>) How do I find out what tables, indexes,
645644
database.</P>
646645

647646
<P>There are also system tables beginning with <I>pg_</I> that describe
648-
these too. Use <I>psql -l</I> will list all databases.</P>
647+
these too.</P>
648+
649+
<P>Use <I>psql -l</I> will list all databases.</P>
649650

650651
<P>Also try the file <I>pgsql/src/tutorial/syscat.source</I>. It
651652
illustrates many of the <SMALL>SELECT</SMALL>s needed to get
652653
information from the database system tables.</P>
653654

654-
<H4><A name="4.3">4.3</A>) How do you remove a column from a
655-
table, or change its data type?</H4>
656-
657-
<P><SMALL>DROP COLUMN</SMALL> functionality was added in release 7.3
658-
with <SMALL>ALTER TABLE DROP COLUMN</SMALL>. In earlier versions,
659-
you can do this:</P>
660-
<PRE>
661-
BEGIN;
662-
LOCK TABLE old_table;
663-
SELECT ... -- select all columns but the one you want to remove
664-
INTO TABLE new_table
665-
FROM old_table;
666-
DROP TABLE old_table;
667-
ALTER TABLE new_table RENAME TO old_table;
668-
COMMIT;
669-
</PRE>
655+
<H4><A name="4.3">4.3</A>) How do you change a column's data type?</H4>
670656

671657
<P>Changing the data type of a column can be done easily in 8.0
672658
and later with <SMALL>ALTER TABLE ALTER COLUMN TYPE</SMALL>.

0 commit comments

Comments
 (0)