dbTalk Databases Forums  

Alter Column

comp.databases.postgresql.novice comp.databases.postgresql.novice


Discuss Alter Column in the comp.databases.postgresql.novice forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Steve Tucknott
 
Posts: n/a

Default Alter Column - 10-27-2004 , 03:43 AM






PostgreSQL 7.4.5

Is there a simple way of altering the definition of a column?

Say I have a column defined as CHAR(5) and I want to make that CHAR(10)
NOT NULL - apart from creating a second table and copying the table,
dropping the original and renaming the copy.

What I am hoping for is 'yes, V8 has ALTER TABLE MODIFY (colName
definition) ' ;-)


Regards,

Steve Tucknott

ReTSol Ltd

DDI: 01903 828769



Reply With Quote
  #2  
Old   
Michael Fuhr
 
Posts: n/a

Default Re: Alter Column - 10-27-2004 , 03:58 AM






On Wed, Oct 27, 2004 at 09:43:43AM +0100, Steve Tucknott wrote:
Quote:
PostgreSQL 7.4.5

Is there a simple way of altering the definition of a column?

Say I have a column defined as CHAR(5) and I want to make that CHAR(10)
NOT NULL - apart from creating a second table and copying the table,
dropping the original and renaming the copy.
This is answered in the FAQ:

http://www.postgresql.org/docs/faqs/FAQ.html#4.4

Quote:
What I am hoping for is 'yes, V8 has ALTER TABLE MODIFY (colName
definition) ' ;-)
In 8.0 you can change a column's type with ALTER TABLE.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.