default value -- best practice question

Поиск
Список
Период
Сортировка
От Aurangzeb M. Agha
Тема default value -- best practice question
Дата
Msg-id Pine.LNX.4.50.0211270322480.32401-100000@cinemaspace.berkeley.edu
обсуждение исходный текст
Список 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 по дате отправления:

Предыдущее
От: Jean-Christian Imbeault
Дата:
Сообщение: Re: 7.3RC2 createlang error
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: Rép