0

I had this issue before, but couldnt formulate my question properly.

This is my trigger creation in postgresql

  CREATE TRIGGER mytrigger
      INSTEAD OF UPDATE
      ON schemename.viewname
      FOR EACH ROW
      EXECUTE PROCEDURE schemename.functioninthisschemename();

This thing works if i do it on local test database, but on server it throws me error:

ERROR: syntax error at or near "INSTEAD" LINE 2: INSTEAD OF UPDATE

Can you please explain me, why i get this error?

1 Answer 1

0

My guess is that this is a versioning issue in Postgres.

Postgres 9.1 supports "instead of" triggers. See here.

Postgres 9.0 and earlier do not support "instead of" triggers. See here.

Sign up to request clarification or add additional context in comments.

2 Comments

looks fair... how do i make trigger for a view then?
@AlexanderCapone . . . That functionality is not supported prior to Postgres 9.1. Here is another question on the subject: stackoverflow.com/questions/451096/execute-trigger-on-view.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.