ALTER COLUMN 
Author Message
 ALTER COLUMN

What's the best way to alter a column definition after the fact (i.e.
int8-->int4).  Is the answer dump, drop table, make new table with new
definition and same name, import data?

Thanks,
Fran

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster



Sun, 26 Oct 2003 04:44:48 GMT
 ALTER COLUMN

Quote:
Fran Fabrizio writes:
> What's the best way to alter a column definition after the fact (i.e.
> int8-->int4).  Is the answer dump, drop table, make new table with new
> definition and same name, import data?

Yes.

--

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://www.postgresql.org/search.mpl



Sun, 26 Oct 2003 05:39:43 GMT
 ALTER COLUMN

Quote:

> Fran Fabrizio writes:
>> What's the best way to alter a column definition after the fact (i.e.
>> int8-->int4).  Is the answer dump, drop table, make new table with new
>> definition and same name, import data?
> Yes.

Dump and reload can be avoided by inserting the data into a temp table
instead.  Should be at least somewhat faster.

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://www.postgresql.org/search.mpl



Sun, 26 Oct 2003 06:13:22 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. multiple ALTER COLUMNs in one ALTER TABLE statement?

2. Alter table alter column text

3. ALTER TABLE ALTER COLUMN

4. Help with Alter Table Alter Column

5. syntax for ALTER TABLE ALTER COLUMN DEFAULT

6. ALTER TABLE ... ALTER COLUMN IDENTITY

7. Alter table alter column syntax

8. Alter table alter column

9. ALTER TABLE/ALTER COLUMN problem with MS Access 2K

10. Alter Table Alter Column Syntax

11. Syntax for using ALTER...ALTER COLUMN...

12. Errors With ALTER TABLE/ALTER COLUMN


 
Powered by phpBB® Forum Software