Simplify set of flags used by MyXactFlags - Mailing list pgsql-hackers

From Michael Paquier
Subject Simplify set of flags used by MyXactFlags
Date
Msg-id 20190118053126.GH1883@paquier.xyz
Whole thread Raw
Responses Re: Simplify set of flags used by MyXactFlags  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
Hi all,

c5660e0 has introduced a new flag for MyXactFlags to restrict
two-phase commit from working with temporary objects, and as a matter
of fact XACT_FLAGS_ACCESSEDTEMPREL has been kept around to keep the
error handling message compatible with past versions, still it is
weird to keep both ACCESSEDTEMPNAMESPACE and ACCESSEDTEMPREL as the
former implies the latter, so attached is a cleanup patch for HEAD.

Keeping both messages makes the error handling at PREPARE time perhaps
a bit cleaner to make the difference about schema-level access or
table-level access, still I'd rather simplify the code and just only
keep the schema-level change as something we complain about.  Another
thing is that ACCESSEDTEMPREL is used in PreCommit_on_commit_actions()
to avoid the truncates of ON COMMIT DELETE ROWS if no temporary tables
have been accessed, still it would just mean that truncation would be
tried on empty tables for nothing even if say a function is created in
pg_temp.

Thoughts?
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: speeding up planning with partitions
Next
From: Haribabu Kommi
Date:
Subject: Re: Libpq support to connect to standby server as priority