Re: Assertion failure on UNLOGGED VIEW and SEQUENCE - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Assertion failure on UNLOGGED VIEW and SEQUENCE
Date
Msg-id 12937.1298056651@sss.pgh.pa.us
Whole thread Raw
In response to Re: Assertion failure on UNLOGGED VIEW and SEQUENCE  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Assertion failure on UNLOGGED VIEW and SEQUENCE
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> OK.  Proposed patch attached.  It looks to me like an unlogged view is
> inherently nonsensical, whereas an unlogged sequence is sensible but
> we don't implement it (and may never implement it, absent some
> evidence that the overhead of WAL logging sequence changes is worth
> getting excited about), so I wrote the error messages to reflect that
> distinction.  I also added a couple of matching regression tests, and
> documented that UNLOGGED works with SELECT INTO.  I put the check for
> views in DefineView adjacent to the other check that already cares
> about relpersistence, and I put the one in DefineSequence to match, at
> the top for lack of any compelling theory of where it ought to go.  I
> looked at stuffing it all the way down into DefineRelation but that
> looks like it would require some other rejiggering of existing logic
> and assertions, which seems pointless and potentially prone to
> breaking things.

Regression tests for this seem pretty pointless (ie, a waste of cycles
forevermore).  +1 for where you put the tests, but I don't think
ERRCODE_SYNTAX_ERROR is an appropriate errcode.  I'd go with
FEATURE_NOT_SUPPORTED for both, I think.  Also, it might be worth
putting some of the above justification into the comments, eg
/* Unlogged sequences are not implemented --- not clear if useful */

versus
/* Unlogged views are pretty nonsensical */

rather than duplicate comments describing non-duplicate cases.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: SR standby hangs
Next
From: Robert Haas
Date:
Subject: Re: review: FDW API