Adding a colum

Started by Steven Lacroixover 25 years ago3 messagesgeneral
Jump to latest
#1Steven Lacroix
lacroix@newwaveindustries.com

I'm pretty new using postgres, but is there any way to add a field to a
table without droping the table and recreating it?

#2Alfred Perlstein
bright@wintelcom.net
In reply to: Steven Lacroix (#1)
Re: Adding a colum

* Steven <lacroix@newwaveindustries.com> [000717 11:28] wrote:

I'm pretty new using postgres, but is there any way to add a field to a
table without droping the table and recreating it?

it's in the docs:
http://www.postgresql.org/docs/user/sql-altertable.htm

--
-Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org]
"I have the heart of a child; I keep it in a jar on my desk."

#3Noname
jeam@themail.com
In reply to: Alfred Perlstein (#2)
Re: Adding a colum

Just use the SQL command:

ALTER TABLE tablename ADD fieldname FIELD TYPE SPECS;

Examples:

ALTER TABLE STUDENTS ADD BIRTHDAY DATE;
ALTER TABLE CUSTOMERS ADD CREDITLIMIT FLOAT4;

Regards, Jorge.
__________________________________________________________________
Make A Buck Or Two @ TheMail.com - Free Internet Email
Sign-up today at http://www.themail.com/ref.htm?ref=908313