Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2012
    Posts
    2

    Unanswered: Getting the OS User

    Hi,
    I am creating an audit trigger and require the operating system user (user logged in to the operating system rather than the database). Is there any way that I can get this info?
    Any help would be greatly appreciated.
    Thanks.

  2. #2
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    AFAIK, no. (You could have a client app that connects to the database without being logged on as a network user, after all.) About the closest you can come is using the inet_client_addr() system information function. Your network admin could probably then cross reference the IP address and timestamp to determine the probable user name. Alternately, they could export the appropriate log files from the name server to your database, so that you could perform the search yourself.
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


  3. #3
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    When postgreSQL is configured to accept remote authentication (GSSAPI/SSPI/Kerberos/Ident/Peer Authentication, for instance,) and the database user has logged in under these protocols, the system user IS the user logged in to the client system. However, you must ensure that there are no postgresql authenticated user logons allowed, otherwise, you can't know with 100 percent certainty.
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •