dbTalk Databases Forums  

New coloumns

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


Discuss New coloumns in the comp.databases.postgresql.novice forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Kumar S
 
Posts: n/a

Default New coloumns - 08-16-2004 , 07:51 AM






Hello group,
I am newbie to postgrSQL and also databases. I am
making a database of proteins. In one table I have 4
columns.
Is it possible that after some time, I can create as
many columns depending on the requirement. if so how
can I add columns to my table? Is that considered as a
major overhaul of the database.

Please help.

Thanks

best
Kumar.

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)


Reply With Quote
  #2  
Old   
Sean Davis
 
Posts: n/a

Default Re: New coloumns - 08-16-2004 , 08:46 AM






Kumar,

While it is possible to add columns to tables, it may be a better idea to
design your database slightly differently. For example, if you have a data
associated with project A that gets stored into a table and there is a
possibility of having projects B and C with data for the same table, instead
of adding Project B column and Project C column, it makes more sense to have
a column in the original table design called Project. In that column, you
store "A", "B", and "C", etc., allowing the table to grow to any number of
projects. Thus, instead of making extra columns, simply add a key column
and your database becomes much more general and useful.

Sean
----- Original Message -----
From: "Kumar S" <ps_postgres (AT) yahoo (DOT) com>
To: <pgsql-novice (AT) postgresql (DOT) org>
Sent: Monday, August 16, 2004 8:51 AM
Subject: [NOVICE] New coloumns


Quote:
Hello group,
I am newbie to postgrSQL and also databases. I am
making a database of proteins. In one table I have 4
columns.
Is it possible that after some time, I can create as
many columns depending on the requirement. if so how
can I add columns to my table? Is that considered as a
major overhaul of the database.

Please help.

Thanks

best
Kumar.

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)



---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

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



Reply With Quote
  #3  
Old   
Kumar S
 
Posts: n/a

Default Re: New coloumns - 08-16-2004 , 10:27 AM



Thank you for your reply Sean. could you let me know
or point me to a place where the SQL commands are
given to add columns to an existing table.
thank you.

Kumar

Sean Davis <sdavis2 (AT) mail (DOT) nih.gov> wrote:Kumar,

While it is possible to add columns to tables, it may
be a better idea to
design your database slightly differently. For
example, if you have a data
associated with project A that gets stored into a
table and there is a
possibility of having projects B and C with data for
the same table, instead
of adding Project B column and Project C column, it
makes more sense to have
a column in the original table design called Project.
In that column, you
store "A", "B", and "C", etc., allowing the table to
grow to any number of
projects. Thus, instead of making extra columns,
simply add a key column
and your database becomes much more general and
useful.

Sean
----- Original Message -----
From: "Kumar S"

To:

Sent: Monday, August 16, 2004 8:51 AM
Subject: [NOVICE] New coloumns


Quote:
Hello group,
I am newbie to postgrSQL and also databases. I am
making a database of proteins. In one table I have 4
columns.
Is it possible that after some time, I can create as
many columns depending on the requirement. if so how
can I add columns to my table? Is that considered as
a
major overhaul of the database.

Please help.

Thanks

best
Kumar.

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam
protection around
http://mail.yahoo.com

---------------------------(end of
broadcast)---------------------------
TIP 2: you can get off all lists at once with the
unregister command
(send "unregister YourEmailAddressHere" to
majordomo (AT) postgresql (DOT) org)







__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings



Reply With Quote
  #4  
Old   
Davis, Sean
 
Posts: n/a

Default Re: New coloumns - 08-16-2004 , 01:43 PM



Kumar,

Sorry for not being specific. Variations of ALTER TABLE will do what you
want:

http://www.postgresql.org/docs/7.4/s...ltertable.html

Sean

-----Original Message-----
From: Kumar S
To: pgsql-novice (AT) postgresql (DOT) org
Sent: 8/16/2004 11:27 AM
Subject: Re: [NOVICE] New coloumns

Thank you for your reply Sean. could you let me know
or point me to a place where the SQL commands are
given to add columns to an existing table.
thank you.

Kumar

Sean Davis <sdavis2 (AT) mail (DOT) nih.gov> wrote:Kumar,

While it is possible to add columns to tables, it may
be a better idea to
design your database slightly differently. For
example, if you have a data
associated with project A that gets stored into a
table and there is a
possibility of having projects B and C with data for
the same table, instead
of adding Project B column and Project C column, it
makes more sense to have
a column in the original table design called Project.
In that column, you
store "A", "B", and "C", etc., allowing the table to
grow to any number of
projects. Thus, instead of making extra columns,
simply add a key column
and your database becomes much more general and
useful.

Sean
----- Original Message -----
From: "Kumar S"

To:

Sent: Monday, August 16, 2004 8:51 AM
Subject: [NOVICE] New coloumns


Quote:
Hello group,
I am newbie to postgrSQL and also databases. I am
making a database of proteins. In one table I have 4
columns.
Is it possible that after some time, I can create as
many columns depending on the requirement. if so how
can I add columns to my table? Is that considered as
a
major overhaul of the database.

Please help.

Thanks

best
Kumar.

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam
protection around
http://mail.yahoo.com

---------------------------(end of
broadcast)---------------------------
TIP 2: you can get off all lists at once with the
unregister command
(send "unregister YourEmailAddressHere" to
majordomo (AT) postgresql (DOT) org)







__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match



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.