Re: unlogged tables - Mailing list pgsql-hackers

From Marti Raudsepp
Subject Re: unlogged tables
Date
Msg-id AANLkTimQ-JmVGJ595f2oLiV5d8WASqQBLKoTd846HZoK@mail.gmail.com
Whole thread Raw
In response to Re: unlogged tables  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: unlogged tables
List pgsql-hackers
On Mon, Nov 15, 2010 at 18:25, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Marti Raudsepp <marti@juffo.org> writes:
>> Would there be a problem with invoking this trigger from the session
>> that first touches the table?
>
> Other than security?

Right, I guess that would only make sense with SECURITY DEFINER.

On Mon, Nov 15, 2010 at 18:22, Robert Haas <robertmhaas@gmail.com> wrote:
> On Mon, Nov 15, 2010 at 10:54 AM, Marti Raudsepp <marti@juffo.org> wrote:
>> Just wondering, have you thought of any mechanisms how application
>> code might detect that an unlogged table was truncated due to restart?

> Yeah, this infrastructure doesn't really allow that.  The truncate
> happens way too early on in startup to execute any user-provided code.

The truncate itself can be performed early and set a flag somewhere
that would invoke a trigger on the first access. I suppose it cannot
be called a "truncate trigger" then.

Or maybe provide hooks for pgAgent instead?

Do you see any alternatives to be notified of unlogged table
truncates? Without notification, this feature would seem to have
limited usefulness.

Regards,
Marti


pgsql-hackers by date:

Previous
From: Eric Davies
Date:
Subject: Re: SQL/MED estimated time of arrival?
Next
From: Robert Haas
Date:
Subject: Re: unlogged tables