Please help me to fix this issue as i am getting it from today morning… After doing some research i have found the issue…
I have a table called… fmb_form_item_answer… [size="2"]in this table i now have records of 1079… the Model name is… [/size][size="2"]FmbFormItemAnswer[/size]
the issue is, after 999 is reached… when i access model->id it gives a text instead of int…
for example…
when when model->id = [size="2"]1079, it generates… 1,079 (with [/size]comma[size="2"] after 1)[/size]
I was able to figure this out after checking the DB logs… below is what i found…
2013-08-19 18:59:53 EST ERROR: invalid input syntax for integer: "1,079"
2013-08-19 18:59:53 EST STATEMENT: SELECT * FROM "fmb_form_item_answer" WHERE submission_id=$1
please can some expert help me to resolve this issue. its a coming up from a production server…
i tried… this way too… setting a rule in model… array(‘id’, ‘numerical’),
CREATE TABLE fmb_form_submission
(
id bigserial NOT NULL,
form_id bigint NOT NULL,
date_added timestamp without time zone NOT NULL DEFAULT now(),
CONSTRAINT pk_fmb_form_submission PRIMARY KEY (id ),
CONSTRAINT fk_fmb_form_submission_fmb_form FOREIGN KEY (form_id)
REFERENCES fmb_form (id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION
)
And in the model its defined as…
/**
* @return array validation rules for model attributes.
*/
public function rules()
{
return array(
array('id', 'numerical'),
);
}
i think PostgreSql have some bugs with bigserial datatype.check this.also as i am checking some forum threads they are also facing same problem with it.