Re: boolean default value
| От | Michael Fuhr |
|---|---|
| Тема | Re: boolean default value |
| Дата | |
| Msg-id | 20050828215145.GA42102@winnie.fuhr.org обсуждение |
| Ответ на | boolean default value ("Michael Schmidt" <MichaelMSchmidt@msn.com>) |
| Список | pgsql-general |
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
В списке pgsql-general по дате отправления: