Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jpYyX-0002Iu-Ht for pgsql-general@arkaria.postgresql.org; Sun, 28 Jun 2020 15:12:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jpYyW-0002LL-HO for pgsql-general@arkaria.postgresql.org; Sun, 28 Jun 2020 15:12:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jpYyU-0002LE-M5 for pgsql-general@lists.postgresql.org; Sun, 28 Jun 2020 15:12:08 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jpYyN-0000hv-4F for pgsql-general@postgresql.org; Sun, 28 Jun 2020 15:12:06 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 2951E5C0129; Sun, 28 Jun 2020 11:11:56 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sun, 28 Jun 2020 11:11:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=r LORS/EnippymNmeeLXRCDGsyXVfMRJszywIODAngs0=; b=ATcgoU95llzeG/dSX cyWhAkRjAqFhIjFlHyfZA5ZdDHfYsWBiAg1beh80Ffi8rSxqE5r1wgsPCTsh2+XA AYvt/eTXJmjsPxnyy3AGrVBzbfS4ORP65g91rCqGv+vh8hkpgpv5rteOn/ggrQcY uGMiTNRjOZfGIyvAcAhScCToFij66MOnDE2PDdPlE5Gx3Y/VqGslljBEUnt0Emgl 49nnQmq51sYCaKlbGZ/LP+bSdnlCdsz0JqJVXXM7xBJbojV7/Vsm8T6WHQ75672y +Sv7uSk5ors+muHxpkOfZFN6SdNViT6PK7OBkoF7G/GH6d5wd6KYOYudJxkQtenV 11XEA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=rLORS/EnippymNmeeLXRCDGsyXVfMRJszywIODAng s0=; b=ZJAY/niEVG2nbJgAQdSO5j2VpwKBSizDNXPdzCK82miit6Eb8qKSLpkeX qx9qXCZdzozRQEQ1rl4h/jUCUQfW0gjlwJXaPfSLdrBfsp6GTvZ6/x67ClgCiP+1 /pb+fUX+RSfQgP+dbsK5X53KTkqc5E8fdqFLGmsBJYBeFk7cikXD7JhQUnl4PhGm ARaEPvqR3WcUDF7Q8bDxOUEmvwRnSa3TM9wML+oMD3/yLR2iEMK2o0WhODt9JrRa krZlOfpQwYYAU1n3lyg1ndyW/T1GMgxPpekXQZDdJ8jIx/9JG/sPXLn2+Ff8Qt+U OQC0yo4V7nTbD+SbOnSW61mZdyxyQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudeliedgkeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhffkffgfgggjtgfgsehtke ertddtfehhnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhk lhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecuggftrfgrthhtvghrnhepledvgeefue euffelgedvgfeukeevgfekieffvdfhhfdtjeduffevgfegfeduuefgnecuffhomhgrihhn pehpohhsthhgrhgvshhqlhdrohhrghenucfkphepjeehrddujedvrdehrddvfedunecuve hluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghn rdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Received: from [192.168.1.3] (75-172-5-231.tukw.qwest.net [75.172.5.231]) by mail.messagingengine.com (Postfix) with ESMTPA id 59F0F3280063; Sun, 28 Jun 2020 11:11:55 -0400 (EDT) Subject: Re: How to get previous log file To: Andrus , pgsql-general References: <7F15982900DB4EC0A233213D0ED79C70@dell2> From: Adrian Klaver Message-ID: <838b1bf7-cdf0-2be7-cc28-9800f3bdee36@aklaver.com> Date: Sun, 28 Jun 2020 08:11:54 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <7F15982900DB4EC0A233213D0ED79C70@dell2> Content-Type: text/plain; charset=windows-1257; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 6/28/20 2:42 AM, Andrus wrote: > Hi! > > select pg_read_file(pg_current_logfile()) > retrieves today log file. > Log files are in log directory: > > /var/lib/postgresql/12/main/log# ls > ... > postgresql-2020-06-08_000000.log  postgresql-2020-06-18_000000.log > postgresql-2020-06-28_000000.log > postgresql-2020-06-09_000000.log  postgresql-2020-06-19_000000.log > > How get yesterday log file from remote client application using > postgresql query ? > Using Postgres 12 in Debian. You where half way there: https://www.postgresql.org/docs/12/functions-admin.html pg_ls_dir() -- To get file names. pg_read_file() -- Using file name from above. > > Andrus. > > > -- Adrian Klaver adrian.klaver@aklaver.com