Using
VB.net 2010
The latest devart.data.PostgreSQL version
PostgreSQL 9.0.2
Hi, I will ask the question and then explain what I’m doing.
Question: Is there a way to pass a variable from an application user interface to the database such that it would be visible to a database trigger and any corresponding function call?
When a record gets deleted, I have a database trigger that fires and writes to a log table. What I want to do is pass a variable from the user interface to the trigger function so I can include this variable in the log record that gets created. I’m not sure how this could even be accomplished unless somehow it was possible to pass a variable through the data connection itself. But even then, how would the trigger function be able to read it and pass it along?
I’m thinking it’s not possible but thought I would ask anyway.
Thanks,
Chris Campbell
Passing variables to PostgreSQL database
As a possible solution, you can set the application_name configuration parameter on your connection object and then read its value from the pg_stat_activity view:
http://www.devart.com/forums/viewtopic.php?t=19313,
http://www.postgresql.org/docs/9.0/inte ... gging.html.
http://www.devart.com/forums/viewtopic.php?t=19313,
http://www.postgresql.org/docs/9.0/inte ... gging.html.