Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gAYoh-0006Zq-MH for pgsql-general@arkaria.postgresql.org; Thu, 11 Oct 2018 11:07:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gAYoc-0003if-BX for pgsql-general@arkaria.postgresql.org; Thu, 11 Oct 2018 11:07:38 +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_SHA384:256) (Exim 4.89) (envelope-from ) id 1gAYoc-0003iY-0m for pgsql-general@lists.postgresql.org; Thu, 11 Oct 2018 11:07:38 +0000 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gAYoZ-00023v-I8 for pgsql-general@postgresql.org; Thu, 11 Oct 2018 11:07:37 +0000 Received: by mail-pg1-x536.google.com with SMTP id 23-v6so4013362pgc.8 for ; Thu, 11 Oct 2018 04:07:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ADiyj6SVzKaV6DYAtSAeWnurpZ6JDYLUiYPhRWZWZDc=; b=nYBorZ2fw6MdkPJjmnwt4grGRGVc923IxozSjrz2lSUI427VN4Ix6VJ6r2O7OHditw wusHknRTIXuEdQtjVz4e94hJo+VyccR5bOEGdvleFu11CPVjnJsVH+NQEektC2NGYnN5 7qIoCq5UPCXcw2YJv00ucxMz2p2+DalMKWhbtJskSQDGRE+DNffPxrruP+lJTMnat6dl Hk6zmgixNrVPCyY4rBj71+Q1pedqYGHCsO8pOd8Z/Jk491j5CheD+WeLO7mBPoQdS2Sb lihSyitX+fOyEJ/KDvw/curnkCeLET+oJLcFZQDxp+ykJRV3hugjeLmWP5kwfQDzpQr1 OHxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ADiyj6SVzKaV6DYAtSAeWnurpZ6JDYLUiYPhRWZWZDc=; b=f7rzC7Pabh8XX/4RlSRpD29JRUjZKO6p6nPNKi+NlSexJeYJaYwyxYSQtZ7UPA2RDS GCBuog1BNaY3DJ5WqVZgVtmUgOQAmOEVI7w6TqsZ+VrthgWegZHHER4TkHhUJPwNjVmV FIhi4LQNYGHEZGyby9bpbyACuNvS44cRKqLb4JomYj7xCytW9owL/l0fpnIXhNMFtC3V PYLnXM6p8RgrEY+iHwPxPueNM7hEhMGv/A7NqNUxhLOn2kWOFzs8pbN7LINI0lMFa8QD mTfh2fGF9MzAVu/AidTalP6ovl2vm8MOfs6IA4YTpjqmTbXG5kxGiMWtgcfDbIGRA/nf ABSA== X-Gm-Message-State: ABuFfojZcuIKgRohWYBu6OiegHI5McUeIXL29OYrdLevVOQ8XNETlAEZ UIcZP+K58mdRTBdv+2cESnvjTYu7QnRI+vO3wy8= X-Google-Smtp-Source: ACcGV62jitGfuUQWSsitaf/RXrVXJMPDK+A6R96rNKZEn8AJ7RLMqGRk92X7BLajoNXeZHEW8es6/2qKp4PnEdanPrs= X-Received: by 2002:a62:c08b:: with SMTP id g11-v6mr1113456pfk.72.1539256052901; Thu, 11 Oct 2018 04:07:32 -0700 (PDT) MIME-Version: 1.0 References: <76CE3E73-7564-441F-9E2B-3F5873D4A153@gmail.com> In-Reply-To: <76CE3E73-7564-441F-9E2B-3F5873D4A153@gmail.com> From: Mike Martin Date: Thu, 11 Oct 2018 12:06:56 +0100 Message-ID: Subject: Re: Advice on logging strategy To: robjsargent@gmail.com Cc: pgsql-general@postgresql.org Content-Type: multipart/alternative; boundary="00000000000040765c0577f1fa2c" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --00000000000040765c0577f1fa2c Content-Type: text/plain; charset="UTF-8" I suppose the ideal would be to log the prepared statement once and detail only if error rather than one per execution On Thu, 11 Oct 2018 at 11:33, Rob Sargent wrote: > > > > On Oct 11, 2018, at 4:26 AM, Mike Martin wrote: > > > > I have a question on logging strategy > > > > I have loggin set to > > log_statement = 'all' on a network database with logging set to csv so I > can import it to a logging table > > > > However the database is populated via a nightly routine downloading data > via REST APIusing prepared statements > > > > This results in enormous log files which take ages to import using copy > becuase each execute statement is logged with the parameters chosen > > > > Is there any way around this? > > > > I cant find any way to filter dml statements > > > > thanks > > > Do you want all the log lines in you logging table? > There was a thread yesterday (10.Oct.2018) on COPY which mention the > possibility of multiple processes COPYing to same table. --00000000000040765c0577f1fa2c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I suppose the ideal would be to log the prepared statement= once and detail only if error rather than one per execution

On Thu, 11 Oct 2018 at 11:33, Rob Sa= rgent <robjsargent@gmail.com> wrote:


> On Oct 11, 2018, at 4:26 AM, Mike Martin <
redtux1@gmail.com> wrote:
>
> I have a question on logging strategy
>
> I have loggin set to
> log_statement =3D 'all' on a network database with logging set= to csv so I can import it to a logging table
>
> However the database is populated via a nightly routine downloading da= ta via REST APIusing prepared statements
>
> This results in enormous log files which take ages to import using cop= y becuase each execute statement is logged with the parameters chosen
>
> Is there any way around this?
>
> I cant find any way to filter dml statements
>
> thanks=C2=A0 =C2=A0 =C2=A0 =C2=A0
>
Do you want all the log lines in you logging table?
There was a thread yesterday (10.Oct.2018) on COPY which mention the possib= ility of multiple processes COPYing to same table.
--00000000000040765c0577f1fa2c--