Tom Lane escribió: > Alvaro Herrera <alvhe...@2ndquadrant.com> writes: > > In this new version, I added a couple of fields to VacuumStmt node. How > > strongly do we feel this would cause an ABI break? Would we be more > > comfortable if I put them at the end of the struct for 9.3 instead? > > In the past we've usually added such members at the end of the struct > in back branches (but put them in the logical place in HEAD). I'd > recommend doing that just on principle.
Okay. > > Also, AutoVacOpts (used as part of reloptions) gained three extra > > fields. Since this is in the middle of StdRdOptions, it'd be somewhat > > more involve to put these at the end of that struct. This might be a > > problem if somebody has a module calling RelationIsSecurityView(). If > > anyone thinks we should be concerned about such an ABI change, please > > shout quickly. > > That sounds problematic --- surely StdRdOptions might be something > extensions are making use of? So can we assume that security_barrier is the only thing to be concerned about? If so, the attached patch should work around the issue by placing it in the same physical location. I guess if there are modules that add extra stuff beyond StdRdOptions, this wouldn't work, but I'm not really sure how likely this is given that our reloptions design hasn't proven to be the most extensible thing in the world. -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
[1;31m*** a/src/include/utils/rel.h[0;0m [1;34m--- b/src/include/utils/rel.h[0;0m [1;35m***************[0;0m [1;35m*** 187,193 **** typedef struct RelationData[0;0m [0;0m * be applied to relations that use this format or a superset for[0;0m [0;0m * private options data.[0;0m [0;0m */[0;0m [1;31m! /* autovacuum-related reloptions. */[0;0m [0;0m typedef struct AutoVacOpts[0;0m [0;0m {[0;0m [0;0m bool enabled;[0;0m [1;35m--- 187,203 ----[0;0m [0;0m * be applied to relations that use this format or a superset for[0;0m [0;0m * private options data.[0;0m [0;0m */[0;0m [1;34m! /*[0;0m [1;34m! * autovacuum-related reloptions.[0;0m [1;34m! *[0;0m [1;34m! * In 9.3 starting from 9.3.3 we use a different struct definition,[0;0m [1;34m! * accomodating security_barrier inside the autovacuum struct, so that new[0;0m [1;34m! * fields could be added at the end. This is so that third-party modules[0;0m [1;34m! * compiled with the original definition of the struct can continue to[0;0m [1;34m! * access the security_barrier field in its original physical location,[0;0m [1;34m! * avoiding an ABI break. (9.4 and up use the normal definition, where[0;0m [1;34m! * security_barrier is placed outside autovacuum options.)[0;0m [1;34m! */[0;0m [0;0m typedef struct AutoVacOpts[0;0m [0;0m {[0;0m [0;0m bool enabled;[0;0m [1;35m***************[0;0m [1;35m*** 200,213 **** typedef struct AutoVacOpts[0;0m [0;0m int freeze_table_age;[0;0m [0;0m float8 vacuum_scale_factor;[0;0m [0;0m float8 analyze_scale_factor;[0;0m [0;0m } AutoVacOpts;[0;0m [0;0m [0;0m [0;0m typedef struct StdRdOptions[0;0m [0;0m {[0;0m [0;0m int32 vl_len_; /* varlena header (do not touch directly!) */[0;0m [0;0m int fillfactor; /* page fill factor in percent (0..100) */[0;0m [1;31m! AutoVacOpts autovacuum; /* autovacuum-related options */[0;0m [1;31m! bool security_barrier; /* for views */[0;0m [0;0m } StdRdOptions;[0;0m [0;0m [0;0m [0;0m #define HEAP_MIN_FILLFACTOR 10[0;0m [1;35m--- 210,226 ----[0;0m [0;0m int freeze_table_age;[0;0m [0;0m float8 vacuum_scale_factor;[0;0m [0;0m float8 analyze_scale_factor;[0;0m [1;34m+ bool security_barrier;[0;0m [1;34m+ int multixact_freeze_min_age;[0;0m [1;34m+ int multixact_freeze_max_age;[0;0m [1;34m+ int multixact_freeze_table_age;[0;0m [0;0m } AutoVacOpts;[0;0m [0;0m [0;0m [0;0m typedef struct StdRdOptions[0;0m [0;0m {[0;0m [0;0m int32 vl_len_; /* varlena header (do not touch directly!) */[0;0m [0;0m int fillfactor; /* page fill factor in percent (0..100) */[0;0m [1;34m! AutoVacOpts autovacuum; /* autovacuum -- includes security_barrier */[0;0m [0;0m } StdRdOptions;[0;0m [0;0m [0;0m [0;0m #define HEAP_MIN_FILLFACTOR 10[0;0m [1;35m***************[0;0m [1;35m*** 238,247 **** typedef struct StdRdOptions[0;0m [0;0m /*[0;0m [0;0m * RelationIsSecurityView[0;0m [0;0m * Returns whether the relation is security view, or not[0;0m [0;0m */[0;0m [0;0m #define RelationIsSecurityView(relation) \[0;0m [0;0m ((relation)->rd_options ? \[0;0m [1;31m! ((StdRdOptions *) (relation)->rd_options)->security_barrier : false)[0;0m [0;0m [0;0m [0;0m /*[0;0m [0;0m * RelationIsValid[0;0m [1;35m--- 251,264 ----[0;0m [0;0m /*[0;0m [0;0m * RelationIsSecurityView[0;0m [0;0m * Returns whether the relation is security view, or not[0;0m [1;34m+ *[0;0m [1;34m+ * XXX this definition copes with unusual placement of the field to preserve[0;0m [1;34m+ * ABI compatibility with releases prior to 9.3.3.[0;0m [0;0m */[0;0m [0;0m #define RelationIsSecurityView(relation) \[0;0m [0;0m ((relation)->rd_options ? \[0;0m [1;34m! ((StdRdOptions *) (relation)->rd_options)->autovacuum.security_barrier : \[0;0m [1;34m! false)[0;0m [0;0m [0;0m [0;0m /*[0;0m [0;0m * RelationIsValid[0;0m
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers