Re: How to set a Default Value
От | Michael Glaesemann |
---|---|
Тема | Re: How to set a Default Value |
Дата | |
Msg-id | E3A2EF99-29E0-4050-B9FD-3CD817BCD436@myrealbox.com обсуждение исходный текст |
Ответ на | How to set a Default Value (Ângelo Marcos Rigo <angelo_rigo@yahoo.com.br>) |
Ответы |
Re: How to set a Default Value
|
Список | pgsql-novice |
On Jan 13, 2006, at 22:10 , Ângelo Marcos Rigo wrote: > I have created a column item varchar(11) with default > value = 0 How did you set the default to 0? Can we see your table definition statement? Also, note that 0 is an integer: you probably want '0' (with the single quotes). > But when i do insert any record the value is set to > null. How are your inserting records? Can we see your insert statement? > How can i always get the defualt value if any other > value is not defined (sometimes it will have some > identification characters) If you want to guarantee that there will always be *some* value, make sure you set the column NOT NULL as well. If this doesn't help, please provide a simple, complete example that shows the behavior you describe so we may help you further. Michael Glaesemann grzm myrealbox com
В списке pgsql-novice по дате отправления: