Search Postgresql Archives

Re: boolean default value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux