这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@rakeshkky
Copy link
Member

@rakeshkky rakeshkky commented Sep 12, 2019

Description

Event triggers are failing if a table contains columns with json/geometry type. It is due to the limitation of the comparison operator (<>) in the trigger definition.

Affected components

  • Server
  • Tests

Related Issues

fix #2036

Solution and Design

Use composite comparison operator *<>, which compares the internal binary representation of two rows.

Steps to test and verify

Follow the reproduction guide given in issue #2036



Update trigger is failing if any json/geometry columns are present in
event payload rows. Use '*<>' operator instead of '<>' to compare the
internal binary representation of rows.
@rakeshkky rakeshkky self-assigned this Sep 12, 2019
@netlify
Copy link

netlify bot commented Sep 12, 2019

Deploy preview for hasura-docs ready!

Built with commit 711cf97

https://deploy-preview-2868--hasura-docs.netlify.com

@hasura-bot
Copy link
Contributor

Review app for commit 9241785 deployed to Heroku: https://hge-ci-pull-2868.herokuapp.com
Docker image for server: hasura/graphql-engine:pull2868-9241785e

@hasura-bot
Copy link
Contributor

Review app for commit 711cf97 deployed to Heroku: https://hge-ci-pull-2868.herokuapp.com
Docker image for server: hasura/graphql-engine:pull2868-711cf970

@lexi-lambda lexi-lambda merged commit e5eb0c4 into hasura:master Sep 12, 2019
@hasura-bot
Copy link
Contributor

Review app https://hge-ci-pull-2868.herokuapp.com is deleted

PERFORM hdb_catalog.insert_event_log(CAST(TG_TABLE_SCHEMA AS text), CAST(TG_TABLE_NAME AS text), CAST('{{NAME}}' AS text), TG_OP, _data);
END IF;
BEGIN
IF (TG_OP <> 'UPDATE') OR (_old <> _new) THEN
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be more performant if we did a check like the following:

IF (TG_OP <> 'UPDATE') THEN
  insert_event_log
ELSE
  BEGIN
    IF (_old <> new) THEN
     insert_event_log
  EXCEPTION WHEN undefined_function THEN
     IF (_old *<> new) THEN
      insert_event_log

polRk pushed a commit to polRk/graphql-engine that referenced this pull request Feb 12, 2020
…ra#2868)

Update trigger is failing if any json/geometry columns are present in
event payload rows. Use '*<>' operator instead of '<>' to compare the
internal binary representation of rows if '<>' doesn’t work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error in update trigger with json/geometry columns

5 participants