{"action":"created","issue":{"url":"https://api.github.com/repos/hangum/TadpoleForDBTools/issues/723","repository_url":"https://api.github.com/repos/hangum/TadpoleForDBTools","labels_url":"https://api.github.com/repos/hangum/TadpoleForDBTools/issues/723/labels{/name}","comments_url":"https://api.github.com/repos/hangum/TadpoleForDBTools/issues/723/comments","events_url":"https://api.github.com/repos/hangum/TadpoleForDBTools/issues/723/events","html_url":"https://github.com/hangum/TadpoleForDBTools/issues/723","id":143407666,"number":723,"title":"PostgreSQL 트리거 생성오류","user":{"login":"sunghoonchung","id":10722674,"avatar_url":"https://avatars.githubusercontent.com/u/10722674?v=3","gravatar_id":"","url":"https://api.github.com/users/sunghoonchung","html_url":"https://github.com/sunghoonchung","followers_url":"https://api.github.com/users/sunghoonchung/followers","following_url":"https://api.github.com/users/sunghoonchung/following{/other_user}","gists_url":"https://api.github.com/users/sunghoonchung/gists{/gist_id}","starred_url":"https://api.github.com/users/sunghoonchung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sunghoonchung/subscriptions","organizations_url":"https://api.github.com/users/sunghoonchung/orgs","repos_url":"https://api.github.com/users/sunghoonchung/repos","events_url":"https://api.github.com/users/sunghoonchung/events{/privacy}","received_events_url":"https://api.github.com/users/sunghoonchung/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-25T02:12:33Z","updated_at":"2016-03-25T04:32:01Z","closed_at":null,"body":"PostgreSQL 9.5에서 트리거 생성시 오류가 발생됩니다.\r\n동일한 트리거문을 pgAdmin에서 실행하면 정상적으로 처리됩니다.\r\n아마 특수기호 때문에 발생되는 오류이지 않나 싶습니다.\r\n\r\nCREATE OR REPLACE FUNCTION TG_INSERT_TEST_TABLE()\r\nRETURNS TRIGGER AS $BODY$\r\nBEGIN\r\n    IF ( NEW.BASE_DATE >= '20160301' AND\r\n         NEW.BASE_DATE < '20160401' ) THEN\r\n        INSERT INTO PT201603_TEST_TABLE VALUES (NEW.*);\r\n    ELSIF ( NEW.BASE_DATE >= '20160401' AND\r\n            NEW.BASE_DATE < '20160501' ) THEN\r\n        INSERT INTO PT201604_TEST_TABLE VALUES (NEW.*);\r\n    ELSE\r\n        RAISE EXCEPTION 'Date out of range.  Fix the TG_INSERT_TEST_TABLE() function!';\r\n    END IF;\r\n    RETURN NULL;\r\nEND;\r\n$BODY$\r\nLANGUAGE plpgsql;\r\n\r\n==[ 에러 메시지 ]============\r\n- SQL 상태 코드: 42601\r\n- SQL 에러 코드: 0\r\n- 메시지 : ERROR: unterminated dollar-quoted string at or near \"$BODY$\r\nLANGUAGE plpgsql\"\r\n  Position: 1"},"comment":{"url":"https://api.github.com/repos/hangum/TadpoleForDBTools/issues/comments/201131683","html_url":"https://github.com/hangum/TadpoleForDBTools/issues/723#issuecomment-201131683","issue_url":"https://api.github.com/repos/hangum/TadpoleForDBTools/issues/723","id":201131683,"user":{"login":"sunghoonchung","id":10722674,"avatar_url":"https://avatars.githubusercontent.com/u/10722674?v=3","gravatar_id":"","url":"https://api.github.com/users/sunghoonchung","html_url":"https://github.com/sunghoonchung","followers_url":"https://api.github.com/users/sunghoonchung/followers","following_url":"https://api.github.com/users/sunghoonchung/following{/other_user}","gists_url":"https://api.github.com/users/sunghoonchung/gists{/gist_id}","starred_url":"https://api.github.com/users/sunghoonchung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sunghoonchung/subscriptions","organizations_url":"https://api.github.com/users/sunghoonchung/orgs","repos_url":"https://api.github.com/users/sunghoonchung/repos","events_url":"https://api.github.com/users/sunghoonchung/events{/privacy}","received_events_url":"https://api.github.com/users/sunghoonchung/received_events","type":"User","site_admin":false},"created_at":"2016-03-25T04:32:01Z","updated_at":"2016-03-25T04:32:01Z","body":"와우.. 빠른 답변 감사합니다. 확인해보고 결과 공유하겠습니다."}}