mirror of
https://github.com/supabase/supabase.git
synced 2026-10-12 04:45:08 +03:00
Co-authored-by: github-docs-sync-bot <github-docs-sync-bot@supabase.com>
19 lines
811 B
Plaintext
19 lines
811 B
Plaintext
---
|
|
title = "NEW variable is null in a trigger function."
|
|
github_url = "https://github.com/orgs/supabase/discussions/15934"
|
|
date_created = "2023-07-20T19:05:52+00:00"
|
|
topics = [ "database", "functions" ]
|
|
keywords = [ "trigger", "function", "statement", "row", "NEW", "OLD", "SQL" ]
|
|
database_id = "f5cabb97-aae3-4fb5-b597-4e7857821753"
|
|
---
|
|
|
|
When you create a function and call it from a trigger the NEW variable is only passed in if the trigger is on ROW operations
|
|
|
|
The UI currently defaults to STATEMENT which will not provide NEW or OLD variables to the function.
|
|
|
|

|
|
|
|
Also in SQL (reference: https://www.postgresql.org/docs/current/sql-createtrigger.html)
|
|
|
|

|