pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Andreas Fröde <psql@andreas.spider-net.de>
To: pgsql-general@lists.postgresql.org
Subject: Re: Findout long unused tables in database
Date: Tue, 27 Sep 2022 06:25:13 +0200
Message-ID: <fd9b5d4c8bb625f44d509eb7b9769490f2d5f368.camel@cybertec.at> (raw)
In-Reply-To: <3d837584-aca0-a8c1-a78b-442071ec723f@andreas.spider-net.de>
References: <3d837584-aca0-a8c1-a78b-442071ec723f@andreas.spider-net.de>

On Mon, 2022-09-26 at 14:05 +0200, Andreas Fröde wrote:
> I am looking for a way to find out when a table was last used for 
> reading. (Without writing every statement in the logfile or putting a 
> trigger on it). Is there such a thing?

No, there is no way to do that short of logging all statements.

I expect that removing permissions on a table and checking whether
your application hits an error is not an option...

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com





view thread (6+ messages)  latest in thread

Message-ID: <fd9b5d4c8bb625f44d509eb7b9769490f2d5f368.camel@cybertec.at>
Permalink:  ../fd9b5d4c8bb625f44d509eb7b9769490f2d5f368.camel@cybertec.at/
Also on:    postgresql.org/message-id/fd9b5d4c8bb625f44d509eb7b9769490f2d5f368.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: laurenz.albe@cybertec.at, psql@andreas.spider-net.de
  Subject: Re: Findout long unused tables in database
  In-Reply-To: <fd9b5d4c8bb625f44d509eb7b9769490f2d5f368.camel@cybertec.at>
  References: <3d837584-aca0-a8c1-a78b-442071ec723f@andreas.spider-net.de> <fd9b5d4c8bb625f44d509eb7b9769490f2d5f368.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox