Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 7d559c8

Browse files
Expand comment for isset_offset.
This field was added in commit 0164a0f to provide a way to determine whether a storage parameter was explicitly set for the relation or if it just picked up the default value. In most cases, this can be accomplished by giving the storage parameter a special out-of-range default value (e.g., the autovacuum_vacuum_insert_threshold storage parameter defaults to -2), but this approach doesn't work in all cases. For example, a Boolean storage parameter cannot be given an out-of-range default, so we need another way to discover the source of its value. Reported-by: "David G. Johnston" <david.g.johnston@gmail.com> Reviewed-by: "David G. Johnston" <david.g.johnston@gmail.com> Discussion: https://postgr.es/m/CAKFQuwYKtEUYKS%2B18gRs-xPhn0qOJgM2KGyyWVCODHuVn9F-XQ%40mail.gmail.com
1 parent aea916f commit 7d559c8

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/include/access/reloptions.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,19 @@ typedef struct
152152
const char *optname; /* option's name */
153153
relopt_type opttype; /* option's datatype */
154154
int offset; /* offset of field in result struct */
155-
int isset_offset; /* if > 0, offset of "is set" field */
155+
156+
/*
157+
* isset_offset is an optional offset of a field in the result struct that
158+
* stores whether the option is explicitly set for the relation or if it
159+
* just picked up the default value. In most cases, this can be
160+
* accomplished by giving the reloption a special out-of-range default
161+
* value (e.g., some integer reloptions use -2), but this isn't always
162+
* possible. For example, a Boolean reloption cannot be given an
163+
* out-of-range default, so we need another way to discover the source of
164+
* its value. This offset is only used if given a value greater than
165+
* zero.
166+
*/
167+
int isset_offset;
156168
} relopt_parse_elt;
157169

158170
/* Local reloption definition */

0 commit comments

Comments
 (0)