default value -- best practice question - Mailing list pgsql-general

From Aurangzeb M. Agha
Subject default value -- best practice question
Date
Msg-id Pine.LNX.4.50.0211270322480.32401-100000@cinemaspace.berkeley.edu
Whole thread Raw
List pgsql-general
I'm adding a new column to one of my tables and wanted to know if there's
any need for me to set a default value since the type of the column is
'int'.

sql1: alter table todo add column clubmusictypeid int;

sql2: alter table todo alter column clubmusictypeid set default 0;

In general (given a column of type int), is it alright to just do sql1 and
forget about setting a default, or are there advantages to defaulting to
0.  I'm presuming that if no default is set, the default is null?

    Thx in Advance,
    Aurangzeb

--
Aurangzeb M. Agha    | Email : aagha@bigfoot.com
PGP ID: 0x68B3A763   |

"Those who would give up essential liberty to purchase a little
 temporary safety deserve neither liberty nor safety."

                    - Benjamin Franklin

pgsql-general by date:

Previous
From: Jean-Christian Imbeault
Date:
Subject: Re: 7.3RC2 createlang error
Next
From: Bruno Wolff III
Date:
Subject: Re: Rép