Simple Postgres table:
Do this:
Everithing's allright:
But doing this
I'm getting the error:
Am I wrong?
CREATE TABLE public.test ( id INTEGER NOT NULL, val BOOLEAN NOT NULL, CONSTRAINT test_pkey PRIMARY KEY(id) );
Do this:
Yii::app()->db->createCommand()->insert('test', array(
'id'=>1,
'val'=>true,
));
Everithing's allright:
Quote
Executing SQL: INSERT INTO "test" ("id", "val") VALUES (:id, :val). Bound with :id=1, :val=true
But doing this
Yii::app()->db->createCommand()->insert('test', array(
'id'=>1,
'val'=>false,
));
I'm getting the error:
Quote
SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for type boolean: ""
LINE 1: INSERT INTO "test" ("id", "val") VALUES ('1', '')
^. The SQL statement executed was: INSERT INTO "test" ("id", "val") VALUES (:id, :val). Bound with :id=1, :val=false
LINE 1: INSERT INTO "test" ("id", "val") VALUES ('1', '')
^. The SQL statement executed was: INSERT INTO "test" ("id", "val") VALUES (:id, :val). Bound with :id=1, :val=false
Am I wrong?