Is it possible to keep track of SELECTs? - Mailing list pgsql-general

From Dominique Devienne
Subject Is it possible to keep track of SELECTs?
Date
Msg-id CAFCRh--Ar40hz6rA5HdyS2dmTaMeOPPHm9M-AJDHpuYsYz+YvQ@mail.gmail.com
Whole thread Raw
Responses Re: Is it possible to keep track of SELECTs?  (Christophe Pettus <xof@thebuild.com>)
Re: Is it possible to keep track of SELECTs?  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-general
Hi,

Our legacy 3-tier backend is adding a feature requested by users,
to keep track of the last-access-time of projects. The primary purpose
is to archive projects which haven't been used (read from) in a while (offline),
or perhaps move them to a cheaper / slower storage tier (still online, but slow access).

In our new 2-tier PostgreSQL-based "backend", project = schema, there's no mid-tier
services we control anymore, only whatever PostgreSQL records about SELECTs.
(I'm assuming other kinds of accesses, like (AUTO or not) VACUUM, are tracked differently).

The docs at [1] mentions:
> The parameter track_counts controls whether cumulative statistics
> are collected about table and index ***accesses***. (emphasis mine)

So is it possible to track the last time a SELECT was performed on some TABLE?
And how would one go about setting that up, if not ON by default?

pgsql-general by date:

Previous
From: Nick Renders
Date:
Subject: Re: could not open file "global/pg_filenode.map": Operation not permitted
Next
From: Christophe Pettus
Date:
Subject: Re: Is it possible to keep track of SELECTs?