Re: [PATCH] A hook for session start

Pavel Stehule <pavel.stehule@gmail.com>

From: Pavel Stehule <pavel.stehule@gmail.com>
To: Nico Williams <nico@cryptonector.com>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>, Jim Mlodgenski <jimmy76@gmail.com>, Robert Haas <robertmhaas@gmail.com>, Craig Ringer <craig@2ndquadrant.com>, Yugo Nagata <nagata@sraoss.co.jp>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>, Fabrízio de Royes Mello <fabriziomello@gmail.com>
Date: 2017-10-07T03:44:00Z
Lists: pgsql-hackers
2017-10-06 21:36 GMT+02:00 Nico Williams <nico@cryptonector.com>:

> On Fri, Oct 06, 2017 at 08:51:53PM +0200, Pavel Stehule wrote:
> > 2017-10-06 20:39 GMT+02:00 Nico Williams <nico@cryptonector.com>:
> > > On Fri, Oct 06, 2017 at 06:37:57PM +0200, Pavel Stehule wrote:
> > > > When we talked about this topic, there are two issues:
> > > >
> > > > a) probably not too hard issue - some internal data can be in
> session sys
> > > > cache.
> > > >
> > > > b) the session sys data should be visible on SQL level too (for some
> > > tools
> > > > and consistency) - it is hard task.
> > >
> > > Can you expand on this?
> >
> > If global temporary tables should be effective, then you have not have
> > modify system catalogue after creating. But lot of processes requires it
> -
> > ANALYZE, query planning.
>
> But the nice thing about them is that you need only create them once, so
> leave them in the catalog.  Stats about them should not be gathered nor
> stored, since they could be different per-session.
>

Unfortunately one field from pg_class are not static - reltuples should be
per session.

But it can be moved to different table

Regards

Pavel

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Add hooks for session start and session end, take two