Default value for bit datatype

From: Terry Fielder <terry(at)greatgulfhomes(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Default value for bit datatype
Date: 2001-06-06 13:57:02
Message-ID: 3B1E36AD.DC39A818@greatgulfhomes.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

When I try to do a default value for the bit datatype, eg:
CREATE TABLE my_calendar (
ID serial NOT NULL ,
Global_field bit DEFAULT 0 NOT NULL ,
)

I get the message:
ERROR: Attribute 'global_field' is of type 'bit' but default expression
is of type 'int4'
You will need to rewrite or cast the expression

I have tried (bit) 0, bit(0), bit 0, etc but have not found a way to do
casting. Can anyone help me to set a default value for a bit datatype
field?

Thanks

Terry Fielder
terry(at)greatgulfhomes(dot)com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Denis Gasparin 2001-06-06 14:14:13 Re: Re: Pgsql vs Interbase: Transaction benchmark
Previous Message Raymond Chui 2001-06-06 13:55:30 Does PostgreSQL support EXISTS?