Re: Trigger is not working for Inserts from the application

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kiran <bangalore(dot)kiran(at)gmail(dot)com>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Trigger is not working for Inserts from the application
Date: 2016-09-10 20:27:50
Message-ID: 10840.1473539270@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Kiran <bangalore(dot)kiran(at)gmail(dot)com> writes:
> LOG: execute <unnamed>: INSERT INTO "myschema"."cf_question"
> ("cf_question_type_id", "cf_question_category_id", "lang", "body") VALUES
> ($1, $2, $3, $4) RETURNING *
> DETAIL: parameters: $1 = '1', $2 = '9', $3 = 'swedish', $4 = '{"name": "Do
> you like Pizza ?", "type": "cat", "store": [{"labeltext": "Yes",
> "labelvalue": 1}, {"labeltext": "No", "labelvalue": 2}, {"labeltext":
> "Other", "labelvalue": 3}, {"labeltext": "Don''t know", "labelvalue": 4}],
> "target": {"place": "Sweden"}, "askfreq": "once", "whydesc": "Because I
> like it :)"}'

Well, the obvious comment on that is "that JSON value hasn't got any qtext
field". So the ->> operator is returning null, the coalesce() is
replacing that with an empty string, and you end up with an empty
tsvector column.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Kiran 2016-09-10 21:02:56 Re: Trigger is not working for Inserts from the application
Previous Message Kiran 2016-09-10 20:15:22 Re: Trigger is not working for Inserts from the application