Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gHpyh-0001E7-Q4 for pgsql-general@arkaria.postgresql.org; Wed, 31 Oct 2018 12:52:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gHpyf-0004ru-Gs for pgsql-general@arkaria.postgresql.org; Wed, 31 Oct 2018 12:52:05 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gHpyd-0004rl-FL for pgsql-general@lists.postgresql.org; Wed, 31 Oct 2018 12:52:05 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gHpyY-0006vU-PC for pgsql-general@postgresql.org; Wed, 31 Oct 2018 12:52:02 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 9816721144; Wed, 31 Oct 2018 08:51:57 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 31 Oct 2018 08:51:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=W l/6JpzoZdXUA6BT0DzwTKm/IxZLHJ4ApekPD301w1A=; b=mvwsUxzXaRmsZwtpx uxALPr2DJM1ux37RFt3fKQSH1PuNnupb3GtNoXtVCm5vPGW9Laf8vPbbVlX0WU1C cTlZuJ+RSXl+pEUKTg1vZGfyOon9DIw71y04E8VoBhenjWo5pTCB9MA1bxS/s2uy +uOS9K3iYl+WaAb3zAr6xbbBL6iIIuran8BpoeYpS71sNYtPcPGodyEmrPs/jIVJ RZa2KqFXGXKCYuLyrLFCkmu/Mf0pKeC2u1wQy7jA2GEPkSpxU6I3fwlT+5BrWtCY qPVAajZPtU8XwiT6CVwPK7e4ETDDgNiFwx43iIker+c9XKn2k8UWjrVSF9VnoerB LnUfw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=fm1; bh=Wl/6JpzoZdXUA6BT0DzwTKm/IxZLHJ4ApekPD301w 1A=; b=Gpf9SmHmWf4FpAXI5wK+5Qy7P6sulztgrlLkSJwYcEHjGZCjTxCBfZzqW hUWHKCvL4dE/GU591ryaD0MHscsg/WaUt2svFDM0OOEoUeSNd/Zdheyv3jB6iTTU WyCRKG03MDpeAYBUCsoDW5o4W/ttXTjy8POkWrpiEaBFIfpUgXpB8eGkX2YVTJBI rIcYN0fcLBwxi+0yb/mb3T5j17n8fDo1yKhdMDbZKBXtIu12IDP8l9tRtu8hpRHq BPtlNm4++46waq1YdtpLA4Yx33595TaVuV87vskCAt4o2P9ooVg3dMsDJoIS6Btl G7BmVkFvZnGRScayEU7XlOIkGFPXw== X-ME-Sender: X-ME-Proxy: Received: from [192.168.1.3] (unknown [71.212.134.3]) by mail.messagingengine.com (Postfix) with ESMTPA id 9D491E443C; Wed, 31 Oct 2018 08:51:56 -0400 (EDT) Subject: Re: Fwd: Log file To: Igor Korot , Tom Lane Cc: pgsql-general References: <18469.1540839366@sss.pgh.pa.us> <23733.1540847335@sss.pgh.pa.us> From: Adrian Klaver Message-ID: Date: Wed, 31 Oct 2018 05:51:55 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 10/30/18 9:20 AM, Igor Korot wrote: > Now is there a command to flush the log - delete the content of it? The only thing I know of is: https://www.postgresql.org/docs/10/static/functions-admin.html pg_rotate_logfile() boolean Rotate server's log file > > All I'm looking for in the log are DDL commands - CREATE/ALTER/DELETE ones. > > > On Wed, Oct 31, 2018 at 12:32 AM Igor Korot wrote: >> >> Hi, Tom, >> >> On Mon, Oct 29, 2018 at 5:08 PM Tom Lane wrote: >>> >>> Igor Korot writes: >>>> On Mon, Oct 29, 2018 at 1:56 PM Tom Lane wrote: >>>>> You can set up the log files as readable by the OS group of the server >>>>> (see log_file_mode), and then grant membership in that group to whichever >>>>> OS accounts you trust. You may also need to move the log directory >>>>> out from under $PGDATA to make that work, since PG doesn't like >>>>> world-readable data directories. >>> >>>> I'm trying to make the log file of PG readable of the user who logs in >>>> to the current >>>> OS session. I don't need a write permission, just read. >>>> Because my program will not be started from the "postgres" account. >>> >>> Well, any such setup is a serious security hole in itself, because >>> there is likely to be sensitive data in the postmaster log, eg >>> passwords. (Remember that the log file is global to the whole cluster, >>> it will not contain just data relevant to the current session.) >>> You should only grant access to people who you trust at more or less >>> the level of trust you'd put in the installation DBA. >>> >>> It may be that these concerns are all irrelevant to you because it's >>> a single-user installation anyway, but they're not irrelevant to >>> people running multi-user installations. So that's why you can't >>> get Postgres to do it. In a single-user installation, maybe you >>> should just launch the postmaster as that user. >>> >>> regards, tom lane >> >> OK, I understand. >> >> Thank you. > > -- Adrian Klaver adrian.klaver@aklaver.com