|
10 | 10 | alink="#0000ff"> |
11 | 11 | <H1>Frequently Asked Questions (FAQ) for PostgreSQL</H1> |
12 | 12 |
|
13 | | - <P>Last updated: Thu May 6 10:22:34 EDT 2004</P> |
| 13 | + <P>Last updated: Fri Jun 4 00:09:16 EDT 2004</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> |
@@ -1213,16 +1213,12 @@ <H4><A name="4.16">4.16</A>) What is an <SMALL>OID</SMALL>? What is |
1213 | 1213 | of the table, with the original <SMALL>OID</SMALL>s, there is no |
1214 | 1214 | reason you can't do it:</P> |
1215 | 1215 | <PRE> |
1216 | | - CREATE TABLE new_table(old_oid oid, mycol int); |
1217 | | - SELECT old_oid, mycol INTO new FROM old; |
1218 | | - COPY new TO '/tmp/pgtable'; |
1219 | | - DELETE FROM new; |
1220 | | - COPY new WITH OIDS FROM '/tmp/pgtable'; |
| 1216 | + CREATE TABLE new_table(mycol int); |
| 1217 | + SELECT oid AS old_oid, mycol INTO tmp_table FROM old_table; |
| 1218 | + COPY tmp_table TO '/tmp/pgtable'; |
| 1219 | + COPY new_table WITH OIDS FROM '/tmp/pgtable'; |
| 1220 | + DROP TABLE tmp_table; |
1221 | 1221 | </PRE> |
1222 | | -<!-- |
1223 | | - CREATE TABLE new_table (mycol int); |
1224 | | - INSERT INTO new_table (oid, mycol) SELECT oid, mycol FROM old_table; |
1225 | | ---> |
1226 | 1222 | <P>O<SMALL>ID</SMALL>s are stored as 4-byte integers, and will |
1227 | 1223 | overflow at 4 billion. No one has reported this ever happening, and |
1228 | 1224 | we plan to have the limit removed before anyone does.</P> |
|
0 commit comments