postgres bool default

Doug Easterbrook doug at artsman.com
Sat Apr 2 22:40:39 UTC 2022


hi martin:

if table exists:

ALTER TABLE IF EXISTS p01_person
    ADD COLUMN p01_active_status boolean DEFAULT true;


or if new table with only one field in it.


CREATE TABLE IF NOT EXISTS p01_person
( p01_active_status boolean DEFAULT true)


those work for us.


Alway try in pgAdmin first.



Doug Easterbrook
Arts Management Systems Ltd.
mailto:doug at artsman.com
http://www.artsman.com
Phone (403) 650-1978

> On April 2, 2022, at 11:41 AM, Martin Obongita via omnisdev-en <omnisdev-en at lists.omnis-dev.com> wrote:
> 
> Hi all,
> How do you default a boolean column to true in postgresql?The below command in postgres does not seem to work well in Omnis: CREATE TABLE p01_person (    p01_active_status boolean DEFAULT TRUE;
> Rgds, Martin.
> _____________________________________________________________
> Manage your list subscriptions at https://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 



More information about the omnisdev-en mailing list