Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hEkZA-0002US-DI for pgsql-general@arkaria.postgresql.org; Fri, 12 Apr 2019 01:01:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hEkYB-0005bV-A7 for pgsql-general@arkaria.postgresql.org; Fri, 12 Apr 2019 01:00:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hEkYA-0005bN-UN for pgsql-general@lists.postgresql.org; Fri, 12 Apr 2019 01:00:15 +0000 Received: from mail-oi1-x242.google.com ([2607:f8b0:4864:20::242]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hEkY1-0004pj-Rv for pgsql-general@postgresql.org; Fri, 12 Apr 2019 01:00:14 +0000 Received: by mail-oi1-x242.google.com with SMTP id v7so6564929oie.8 for ; Thu, 11 Apr 2019 18:00:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=BxWI4gvaRoJpbFUPij2Gp605gBW7UqJtsUCuKjAhmOU=; b=IskE1QIt8LbbIwf2jxjkLfN45DR7R30BP4O7zHJDkw+n/oO5qXhSPWFHY9AjcAHgsr F2g/pQoLq/9Rku8EKt8DCkpjwJZ1BPaDIqYjIcPsq9/EnvZIKmv9oBbjJiWz6ubfsaUG k7UvAbYJ5NClVNrC/ESgD1m4SM+ZQt5Sap8jfHoX6wxbDoeIBUKQyBRyqYlF+y2VJaS/ 5EZR25M2hfNn+elCHFMIZxyigEW7D9y4m4HpiZV0UN800dpp5wH5TJfSpFqQrFeZtO1Q Wydi8R9P/GI8rNMiYaiCJZrBILsXpqarb/UCcaDliecvbLmyx/yZzPwA3lUO9PhzRfbk AbZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=BxWI4gvaRoJpbFUPij2Gp605gBW7UqJtsUCuKjAhmOU=; b=p+CeQIXIc99QMyeCvNs7dTJ9I07A8gIDdQIWwoMUH4gKLh/tah6k635FsPaCXjAGBK SEz8z2nF/tUEG2WWYWGn4ofDUCRVnkmTe5qOZEY7ntUN3mC59vuQAEKTe7li7kQhvbYG 7Y0wvxdhs35dF6g9o8Z4fFU1RWBHYIQmCb9kwSEBz0sAo32FxcQ6VoLCiYuS4QqQHYv3 5NA1fmluqO0x1MYNX80A8HGu78JHAazTeUGb468UQW5TyzYn9xi6V2i70o9vPkbIYnNM hvQDkidgFFOVe+7u0wmJeQmM6Ds6PYfpdrgcvaT2wyYNZnZ1jDRceqjNlI6GTIJjYziS hkHg== X-Gm-Message-State: APjAAAWFBMtoCEkO8Ya2paXPRDfeLtJkWlUz9UkUA7Uk1RaaOTsST80F kn/006g0vvf5T7IqbgPEOHKy89juxkw= X-Google-Smtp-Source: APXvYqw4u+zCrbpg3lV2rCPNxUhD8BFUoVH7xVGr0uWZYa9Xb+RmiH0vqFoaot/irl1ZUlKBXjqSeg== X-Received: by 2002:aca:c5cd:: with SMTP id v196mr7736654oif.90.1555030802363; Thu, 11 Apr 2019 18:00:02 -0700 (PDT) Received: from [192.168.1.10] (ip70-171-116-89.no.no.cox.net. [70.171.116.89]) by smtp.googlemail.com with ESMTPSA id a198sm16520667oib.19.2019.04.11.18.00.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Apr 2019 18:00:01 -0700 (PDT) To: Forums postgresql From: Ron Subject: Trigger when user logs in Message-ID: Date: Thu, 11 Apr 2019 20:00:00 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, PCI auditors have mandated that our databases (all running v9.6) send an email when certain users log in.  Thus, I've been searching for how to do this, but without much luck. https://www.postgresql.org/message-id/flat/20170720204733.40f2b7eb.nagata%40sraoss.co.jp This long thread from almost two years ago seems to point in the right direction, but then died with "Okay, this has proved to require broader changes than thought first. I am marking the patch as returned with feedback." So, is there something that I've missed which lets me write an "on login" trigger, or do I have to install pgaudit and tail_n_mail? Thanks -- Angular momentum makes the world go 'round.