On Fri, 2002-01-11 at 03:14, Sharon Cowling wrote:
>
> user=> \d
> Table "person4"
> Attribute | Type | Modifier
> ------------------+-----------------------+--------------
...
> drivers_licence | character varying(20) | default 'No'
...
>
> user=> select * from person4;
> person_id | firstname | lastname | dob | street | suburb | city | homephone | workphone | mobile | type
| date_approved | approved_by | vehicle_type | vehicle_rego | drivers_licence | firearms_licence | notes
>
-----------+-----------+----------+------------+--------+--------+------+-----------+-----------+--------+----------------+---------------+-------------+--------------+--------------+-----------------+------------------+-------
> 778 | sdf | sdf | 11/11/1977 | sf | | dsf | | | |
Owner/Relative| 11/01/2002 | test | | | | |
> (1 row)
>
> As you can see there is no default value of 'No' for drivers licence.
The default only operates if you do an insert without mentioning the
column. It will not override an explicitly inserted null or empty
string.
--
Oliver Elphick Oliver.Elphick@lfix.co.uk
Isle of Wight http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
"Enter into his gates with thanksgiving, and into his
courts with praise. Be thankful unto him, and bless
his name." Psalms 100:4