Simplify set of flags used by MyXactFlags

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Simplify set of flags used by MyXactFlags
Date: 2019-01-18 05:31:26
Message-ID: 20190118053126.GH1883@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: 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 Content-Type Size
0001-Simplify-2PC-restriction-handling-for-temporary-obje.patch text/x-diff 8.1 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Haribabu Kommi 2019-01-18 05:34:41 Re: Libpq support to connect to standby server as priority
Previous Message Amit Langote 2019-01-18 05:28:32 Re: speeding up planning with partitions