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 1kgQjb-0003Aa-TI for pgsql-general@arkaria.postgresql.org; Sat, 21 Nov 2020 11:07:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kgQja-0006RY-Fv for pgsql-general@arkaria.postgresql.org; Sat, 21 Nov 2020 11:07:14 +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 1kgQja-0006RQ-8G for pgsql-general@lists.postgresql.org; Sat, 21 Nov 2020 11:07:14 +0000 Received: from mail.hjp.at ([212.17.106.138] helo=rorschach.hjp.at) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kgQjV-0000jm-4d for pgsql-general@lists.postgresql.org; Sat, 21 Nov 2020 11:07:11 +0000 Received: by rorschach.hjp.at (Postfix, from userid 1000) id B0C443DFD; Sat, 21 Nov 2020 12:07:05 +0100 (CET) Date: Sat, 21 Nov 2020 12:07:05 +0100 From: "Peter J. Holzer" To: pgsql-general@lists.postgresql.org Subject: Re: pg_dump - how to force to show timestamps in client log Message-ID: <20201121110705.GA19224@hjp.at> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="jRHKVT23PllUwdXP" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --jRHKVT23PllUwdXP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2020-11-20 19:01:47 +0100, Durumdara wrote: > We need to log the pg_dump's state. > What objects are in copy, and what are the starting and ending times. >=20 > But when I try to redirect the output, the result doesn't have timestamps. >=20 > PG 11, on Windows. >=20 > As I see the -v option isn't enough to see the starting times. >=20 > For example: >=20 > 2020-11-19 12:00:01.084 Dump table content table1 > 2020-11-19 12:03:12.932 Dump table content table2 You can pipe the output through a timestamping tool like this: pg_dump --compress=3D5 -v -Fd -f "$name.$$" $db 2>&1 | ts > log/"$name".$(i= sodate).log ts is available here: https://github.com/hjp/simple/tree/master/ts hp --=20 _ | Peter J. Holzer | Story must make more sense than reality. |_|_) | | | | | hjp@hjp.at | -- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" --jRHKVT23PllUwdXP Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAl+49NUACgkQ8g5IURL+ KF1Iaw/+NPGJPKHvYzv8C3L+miFyLX7o1cNk+HJHgz8FVhR0qKOkoBFkjxl6tfVo kY0zyF6iWrjnX51Ms35v0k/9JGHUNWnQ8FZbvGTq1vUTAdLWWT8+H7T4dNt9Rdc2 djBl3fl3edPkqh3M5/K3+ijPU79peaXcnzRB4qSsi3hv1KScm4snVAxJqXYxemPR CqlFxkkjfbS8p9oWgxwYXwG9eJnx8TeD1d+47bifXBbMgmzoLSYQe7PJeOXzq5OY eAN8nKNhT1SZKV3v4B4hl57mrzdych9oVil67i84PGhjj+poL9U6oOivBeP0pgH8 xkc8duBzVZR9ZEw5U6tRN102rtKtCNq3kthNw6FPc63T647nnkm4PFX++nUcQvse PxUiIWi6iDzU3z4AjGbkUZ7G5vEKQqAyROkZF+EPoUycO9+/nCrMLJVcDb+Cuo26 UrbD0IjBTXEwxTTUblWEO8zOsex4RGPB4x6+vujnWCAcPh1k95Ucovu4ol5x7KtD wZOYysfMkIQvMlyQudhaCaqrVeWqYB/BRLeL4KGUgFRcw4C3EfUzq1GDfQSatvna j1z+kJl2MbCg9GEAa8inCf90+mAoM958XbiFGgTXOuQXnm8xfchBfsF81B7oaky6 wkANilSYQeHZp41dy+Scw+8yYqHD/IebTh0VaerqSDBV68Qhnek= =JY5r -----END PGP SIGNATURE----- --jRHKVT23PllUwdXP--