10000 docs: clarify that only INSERT and UPDATE triggers can mod. NEW · postgres/postgres@c10fae2 · GitHub
[go: up one dir, main page]

Skip to content
{"payload":{"commit":{"oid":"c10fae21428fe926568e67b7662ed8577faf9235","url":"/postgres/postgres/commit/c10fae21428fe926568e67b7662ed8577faf9235","authoredDate":"2019-11-07T15:50:00.000-05:00","committedDate":"2019-11-07T15:50:00.000-05:00","shortMessage":null,"shortMessageMarkdown":"\u003cdiv\u003edocs: clarify that only INSERT and UPDATE triggers can mod. NEW\u003c/div\u003e","shortMessageMarkdownLink":null,"bodyMessageHtml":"The point is that DELETE triggers cannot modify any values.\n\nReported-by: Eugen Konkov\n\nDiscussion: \u003ca href=\"https://postgr.es/m/919823407.20191029175436@yandex.ru\" rel=\"nofollow\"\u003ehttps://postgr.es/m/919823407.20191029175436@yandex.ru\u003c/a\u003e\n\nBackpatch-through: 9.4","authors":[{"login":"bmomjian","displayName":"Bruce Momjian","avatarUrl":"https://avatars.githubusercontent.com/u/412153?v=4","path":"/bmomjian","isGitHub":false}],"committerAttribution":false,"committer":{"login":"bmomjian","displayName":"Bruce Momjian","avatarUrl":"https://avatars.githubusercontent.com/u/412153?v=4","path":"/bmomjian","isGitHub":false},"parents":["c8cb98ec41f0c41ac3b4c3e8be01f12c4c53d3aa"],"globalRelayId":"MDY6Q29tbWl0OTI3NDQyOmMxMGZhZTIxNDI4ZmU5MjY1NjhlNjdiNzY2MmVkODU3N2ZhZjkyMzU=","sha1":"c8cb98ec41f0c41ac3b4c3e8be01f12c4c53d3aa","sha2":"c10fae21428fe926568e67b7662ed8577faf9235"},"currentUser":null,"repo":{"id":927442,"defaultBranch":"master","name":"postgres","ownerLogin":"postgres","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2010-09-21T11:35:45.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/177543?v=4","public":true,"private":false,"isOrgOwned":true},"diffEntryData":[{"diffLines":[{"stylingDirective":null,"type":"HUNK","blobLineNumber":229,"text":"@@ -230,7 +230,7 @@","html":"@@ -230,7 +230,7 @@","displayNoNewLineWarning":false,"position":0,"left":229,"right":229},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":230,"text":" used to signal that the trigger performed the necessary data","html":" used to signal that the trigger performed the necessary data","displayNoNewLineWarning":false,"position":1,"left":230,"right":230},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":231,"text":" modifications in the view. This will cause the count of the number","html":" modifications in the view. This will cause the count of the number","displayNoNewLineWarning":false,"position":2,"left":231,"right":231},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":232,"text":" of rows affected by the command to be incremented. For","html":" of rows affected by the command to be incremented. For","displayNoNewLineWarning":false,"position":3,"left":232,"right":232},{"stylingDirective":null,"type":"DELETION","blobLineNumber":233,"text":"- \u003ccommand\u003eINSERT\u003c/command\u003e and \u003ccommand\u003eUPDATE\u003c/command\u003e operations, the trigger","html":"- \u0026lt;command\u0026gt;INSERT\u0026lt;/command\u0026gt; and \u0026lt;command\u0026gt;UPDATE\u0026lt;/command\u0026gt; operations, the trigger","displayNoNewLineWarning":false,"position":4,"left":233,"right":232},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":233,"text":"+ \u003ccommand\u003eINSERT\u003c/command\u003e and \u003ccommand\u003eUPDATE\u003c/command\u003e operations only, the trigger","html":"+ \u0026lt;command\u0026gt;INSERT\u0026lt;/command\u0026gt; and \u0026lt;command\u0026gt;UPDATE\u0026lt;/command\u0026gt; operations\u003cspan class=\"x x-first x-last\"\u003e only\u003c/span\u003e, the trigger","displayNoNewLineWarning":false,"position":5,"left":233,"right":233},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":234,"text":" may modify the \u003cvarname\u003eNEW\u003c/varname\u003e row before returning it. This will","html":" may modify the \u0026lt;varname\u0026gt;NEW\u0026lt;/varname\u0026gt; row before returning it. This will","displayNoNewLineWarning":false,"position":6,"left":234,"right":234},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":235,"text":" change the data returned by","html":" change the data returned by","displayNoNewLineWarning":false,"position":7,"left":235,"right":235},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":236,"text":" \u003ccommand\u003eINSERT RETURNING\u003c/command\u003e or \u003ccommand\u003eUPDATE RETURNING\u003c/command\u003e,","html":" \u0026lt;command\u0026gt;INSERT RETURNING\u0026lt;/command\u0026gt; or \u0026lt;command\u0026gt;UPDATE RETURNING\u0026lt;/command\u0026gt;,","displayNoNewLineWarning":false,"position":8,"left":236,"right":236}],"diffNumber":0,"diffSize":"0 Bytes","isBinary":false,"isTooBig":false,"collapsed":false,"isSubmodule":false,"lineCount":974,"linesChanged":2,"newTreeEntry":{"lineCount":974,"path":"doc/src/sgml/trigger.sgml","mode":100644,"isGenerated":false},"oldTreeEntry":{"lineCount":0,"path":"doc/src/sgml/trigger.sgml","mode":100644},"linesAdded":1,"linesDeleted":1,"path":"doc/src/sgml/trigger.sgml","pathDigest":"8637438928a7ff97d9ae2316375ff46c24ddf36e5e6a49ccd129d40b7d5db303","status":"MODIFIED","truncatedReason":null,"oldOid":"c8cb98ec41f0c41ac3b4c3e8be01f12c4c53d3aa","newOid":"c10fae21428fe926568e67b7662ed8577faf9235","copilotChatReference":null,"deletedSha":"c8cb98ec41f0c41ac3b4c3e8be01f12c4c53d3aa","canToggleRichDiff":false,"defaultToRichDiff":false,"proseDifffHtml":null,"renderInfo":null,"dependencyDiffPath":null,"submodule":null}],"splitViewPreference":"unified","ignoreWhitespace":false,"repoOwnerGlobalRelayId":"MDEyOk9yZ2FuaXphdGlvbjE3NzU0Mw==","commentsPreference":"visible","diffLineSpacingPreference":"relaxed","useMonospaceFont":false,"pasteUrlLinkAsPlainText":false,"userNotices":[],"path":"/postgres/postgres/commit/c10fae21428fe926568e67b7662ed8577faf9235","fileTreeExpanded":true,"headerInfo":{"additions":1,"deletions":1,"filesChanged":1,"filesChangedString":"1"},"moreDiffsToLoad":false,"asyncDiffLoadInfo":{"startIndex":1,"truncated":false,"byteCount":586,"lineShownCount":9},"commentInfo":{"canComment":false,"locked":false,"canLock":false,"repoArchived":false},"csrf_tokens":{"/users/diffview?diff=split":{"post":"VFgeufOO_oGWcVBzKgHs463Sh3ZO9AOOlKp8xqmwKGT4DPCt_w2hJ7kmqmCPobvPxtLhZvWuYuLr0NXSy8llHw"},"/users/diffview?diff=unified":{"post":"CKysV8-fZMTlY-aGT-ppBBzU0Ytc7hegzTYWs9y17qKk-EJDwxw7Yso0HJXqSj4od9S3m-e0dsyyTL-nvsyj2Q"},"/notifications/thread":{"post":"vNfymMDpRh9cZ-nS0tAj7BAJ9XFO3kbw_0fpgaQrhM4zGf5y39dCZ4mb2CNm26wKXoKCyff9smM6mcYYRkDByA"}}},"title":"docs: clarify that only INSERT and UPDATE triggers can mod. NEW · postgres/postgres@c10fae2","appPayload":{"helpUrl":"https://docs.github.com","findInDiffWorkerPath":"/assets-cdn/worker/find-in-diff-worker-2bfe39677d14.js","enabled_features":{"diff_ux_refresh_beta":false,"diff_inline_comments":true,"diff_ux_refresh_ssr_five":false,"diff_ux_refresh_ssr_ten":false,"react_diff_line_type_character_correction":true}}}

Commit c10fae2

Browse files
committed
docs: clarify that only INSERT and UPDATE triggers can mod. NEW
The point is that DELETE triggers cannot modify any values. Reported-by: Eugen Konkov Discussion: https://postgr.es/m/919823407.20191029175436@yandex.ru Backpatch-through: 9.4
1 parent c8cb98e commit c10fae2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/src/sgml/trigger.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@
230230
used to signal that the trigger performed the necessary data
231231
modifications in the view. This will cause the count of the number
232232
of rows affected by the command to be incremented. For
233-
<command>INSERT</command> and <command>UPDATE</command> operations, the trigger
233+
<command>INSERT</command> and <command>UPDATE</command> operations only, the trigger
234234
may modify the <varname>NEW</varname> row before returning it. This will
235235
change the data returned by
236236
<command>INSERT RETURNING</command> or <command>UPDATE RETURNING</command>,

0 commit comments

Comments
 (0)
0