If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Unanswered: Get Client Info, IP, OS Account

Hello,

PostgreSQL 9 on Linux Box.
The Application on the Middle Tier will be able to get the Client's IP and OS Account. But how to store these info into to PostgreSQL, so that TRIGGER will be able to obtain them?

The trigger on the Table will insert a record into our log table when the value changed in some columns with new and old values. And also need to know the Client IP and OS Account.

Without knowing a lot more about your server architecture and the software you have written for your application server I don't know how to be more specific, so I'll try to explain the process in a different way...

Your application server gets some data used by your application. This data can come from a web page, a SOAP or other API stream, a "fat client", or some other way. The mechanics of the process aren't important to this discussion, but somehow data gets from the user to your app server and gets passed on to be stored inside the database.

Your application can get the connection information like the client IP address and OS Account, and the mechanics of that process may be different but the basic procedure is the same.

Once you have all of the data on the application server that you need for a transaction, the application server can pass that data to the database. The mechanics of passing the connection data and the application data that are stored on the application server on to the database server are identical... You can (and probably should) pass the connection data at the same time as the application data.

-PatP

In theory, theory and practice are identical. In practice, theory and practice are unrelated.