|
10 | 10 | alink="#0000ff">
|
11 | 11 | <H1>Frequently Asked Questions (FAQ) for PostgreSQL</H1>
|
12 | 12 |
|
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> |
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>)
|
@@ -74,8 +74,7 @@ <H2 align="center">Operational Questions</H2>
|
74 | 74 | <A href="#4.2">4.2</A>) How do I find out what tables, indexes,
|
75 | 75 | databases, and users are defined? How do I see the queries used
|
76 | 76 | 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> |
79 | 78 | <A href="#4.4">4.4</A>) What is the maximum size for a row, a
|
80 | 79 | table, and a database?<BR>
|
81 | 80 | <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,
|
645 | 644 | database.</P>
|
646 | 645 |
|
647 | 646 | <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> |
649 | 650 |
|
650 | 651 | <P>Also try the file <I>pgsql/src/tutorial/syscat.source</I>. It
|
651 | 652 | illustrates many of the <SMALL>SELECT</SMALL>s needed to get
|
652 | 653 | information from the database system tables.</P>
|
653 | 654 |
|
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> |
670 | 656 |
|
671 | 657 | <P>Changing the data type of a column can be done easily in 8.0
|
672 | 658 | and later with <SMALL>ALTER TABLE ALTER COLUMN TYPE</SMALL>.
|
|
0 commit comments