Home > Archive > PostgreSQL Discussion > August 2005 > boolean default value









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author boolean default value
Michael Schmidt

2005-08-28, 8:23 pm

I've not been able to find anything on this in the groups or by Google. I have a table with several boolean columns, all not null and with either 'true' or 'false' as default values. I've been testing the system in pgAdmin III. When I insert a new record, all the boolean columns are set 'false', including the ones I have set the default value as 'true'. Has anyone else had this problem?

Michael Schmidt
Michael Fuhr

2005-08-28, 8:23 pm

On Sun, Aug 28, 2005 at 03:31:17PM -0600, Michael Schmidt wrote:
> I've not been able to find anything on this in the groups or by
> Google. I have a table with several boolean columns, all not null and
> with either 'true' or 'false' as default values. I've been testing the
> system in pgAdmin III. When I insert a new record, all the boolean
> columns are set 'false', including the ones I have set the default value
> as 'true'. Has anyone else had this problem?


Works fine here with psql in every version I tested (7.2.8, 7.3.10,
7.4.8, 8.0.3, 8.1beta1):

CREATE TABLE foo (
i integer NOT NULL,
bt boolean NOT NULL DEFAULT TRUE,
bf boolean NOT NULL DEFAULT FALSE
);

INSERT INTO foo (i) VALUES (1);

SELECT * FROM foo;
i | bt | bf
---+----+----
1 | t | f
(1 row)

Have you tried with psql instead of pgAdmin III? If you see the
problem with psql then please post a self-contained example (and
state what version of PostgreSQL you're using).

--
Michael Fuhr

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Michael Schmidt

2005-08-28, 8:23 pm

Mr. Fuhr,
Thanks for your quick response. In fact, the problem doesn't occur in psql or in EMS PostgreSQL Manager. It appears unique to pgAdmin III. In the future, I'll check such things with psql before asking a (potentially dumb) question. Again, thanks!

Michael Schmidt
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com