diff options
author | Nathan Bossart <nathan@postgresql.org> | 2025-03-24 15:47:02 -0500 |
---|---|---|
committer | Nathan Bossart <nathan@postgresql.org> | 2025-03-24 15:47:02 -0500 |
commit | 7d559c8580f722dc40f2c34573e53e33626679e0 (patch) | |
tree | 65ce043e01afc83c55ab52c29aede20bfc6937da /src | |
parent | aea916fe555a351fe20bf31d56f5f0d027d9db61 (diff) | |
download | postgresql-7d559c8580f722dc40f2c34573e53e33626679e0.tar.gz postgresql-7d559c8580f722dc40f2c34573e53e33626679e0.zip |
Expand comment for isset_offset.
This field was added in commit 0164a0f9ee 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
Diffstat (limited to 'src')
-rw-r--r-- | src/include/access/reloptions.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/include/access/reloptions.h b/src/include/access/reloptions.h index 146aed47c2d..dfbb4c85460 100644 --- a/src/include/access/reloptions.h +++ b/src/include/access/reloptions.h @@ -152,7 +152,19 @@ typedef struct const char *optname; /* option's name */ relopt_type opttype; /* option's datatype */ int offset; /* offset of field in result struct */ - int isset_offset; /* if > 0, offset of "is set" field */ + + /* + * isset_offset is an optional offset of a field in the result struct that + * stores whether the option is explicitly set for the relation or if it + * just picked up the default value. In most cases, this can be + * accomplished by giving the reloption a special out-of-range default + * value (e.g., some integer reloptions use -2), but this isn't always + * possible. For example, a Boolean reloption cannot be given an + * out-of-range default, so we need another way to discover the source of + * its value. This offset is only used if given a value greater than + * zero. + */ + int isset_offset; } relopt_parse_elt; /* Local reloption definition */ |