Hello devs, There is a `new` variable available in...
# help
d
Hello devs, There is a
new
variable available in postgres trigger function and I can access values like
new.email
new.id
. I wanted to also know about value of provider through which register was done and tried with
new.provider
, but couldnot retrieve. Is there any docs available regarding
new
variable or is there any way to log
new
variable in function to see what is coming. Thanks for the help 🙏
n
Hello @dipesh! This thread has been automatically created from your message in #843999948717555735 a few seconds ago. We have already mentioned the @User so that they can see your message and help you as soon as possible! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ``...`` menu) and select "Leave Thread" to unsubscribe from future updates. Want to change the title? Use the ``/title`` command! We have solved your problem? Click the button below to archive it.
g
What table are you triggering on? provider is not a column on auth.user (email and id are). New normally reflects what is about to be inserted/updated into a row. You can log info in a function with
Copy code
raise log 'string'
https://www.postgresql.org/docs/current/plpgsql-errors-and-messages.html
n
dipesh (2022-05-21)
d
I could retrieve provider value by
new.raw_app_meta_data::json->'provider')
. LOG really helped. Thank you 🙇‍♂️
n
Thread was archived by @dipesh. Anyone can send a message to unarchive it.