Re: Table rewrite supporting functions for event triggers
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: Greg Sabino Mullane <htamfids@gmail.com>, pgsql-docs <pgsql-docs@lists.postgresql.org>
Date: 2024-09-11T06:00:31Z
Lists: pgsql-docs
On Tue, Sep 03, 2024 at 09:34:02PM +0200, Laurenz Albe wrote: > On Tue, 2024-09-03 at 11:54 -0400, Greg Sabino Mullane wrote: >> How about something like this? > > This patch looks good to me. - Returns a code explaining the reason(s) for rewriting. The exact - meaning of the codes is release dependent. + Returns a code explaining the reason(s) for rewriting. The value is + a bitmap built from the following values: 1 (the table has changed + persistence), 2 (a column has changed a default value), 4 (a column + has a new data type), and 8 (the table access method has changed). Agreed that the user experience with this function is poor and that the documentation should be improved. Still, I am not sure that this is optimal. On top of the values, how about adding the variable names and also mention that these are defined in event_trigger.h? Putting the documentation change aside for a bit, could it be better to redesign this function and return a text value rather than an integer? We could directly return the names, minus "AT_REWRITE_", for instance. -- Michael
Commits
-
doc: Add better description for rewrite functions in event triggers
- 93a596c73517 13.17 landed
- bca802600c7f 14.14 landed
- 14440d3b07af 15.9 landed
- a1b859c6893a 16.5 landed
- 709ce29b1656 17.1 landed
- 4b7bba49e712 18.0 landed