2222PG_MODULE_MAGIC ;
2323
2424/* parse table for fillRelOptions */
25- static relopt_parse_elt di_relopt_tab [6 ];
25+ static relopt_parse_elt di_relopt_tab [8 ];
2626
2727/* Kind of relation options for dummy index */
2828static relopt_kind di_relopt_kind ;
@@ -40,6 +40,8 @@ typedef struct DummyIndexOptions
4040 int option_int ;
4141 double option_real ;
4242 bool option_bool ;
43+ ternary option_ternary1 ;
44+ ternary option_ternary2 ;
4345 DummyAmEnum option_enum ;
4446 int option_string_val_offset ;
4547 int option_string_null_offset ;
@@ -96,23 +98,37 @@ create_reloptions_table(void)
9698 di_relopt_tab [2 ].opttype = RELOPT_TYPE_BOOL ;
9799 di_relopt_tab [2 ].offset = offsetof(DummyIndexOptions , option_bool );
98100
101+ add_ternary_reloption (di_relopt_kind , "option_ternary1" ,
102+ "First ternary option for dummy_index_am" ,
103+ TERNARY_UNSET , NULL , AccessExclusiveLock );
104+ di_relopt_tab [3 ].optname = "option_ternary1" ;
105+ di_relopt_tab [3 ].opttype = RELOPT_TYPE_TERNARY ;
106+ di_relopt_tab [3 ].offset = offsetof(DummyIndexOptions , option_ternary1 );
107+
108+ add_ternary_reloption (di_relopt_kind , "option_ternary2" ,
109+ "Second ternary option for dummy_index_am" ,
110+ TERNARY_TRUE , "do_not_know_yet" , AccessExclusiveLock );
111+ di_relopt_tab [4 ].optname = "option_ternary2" ;
112+ di_relopt_tab [4 ].opttype = RELOPT_TYPE_TERNARY ;
113+ di_relopt_tab [4 ].offset = offsetof(DummyIndexOptions , option_ternary2 );
114+
99115 add_enum_reloption (di_relopt_kind , "option_enum" ,
100116 "Enum option for dummy_index_am" ,
101117 dummyAmEnumValues ,
102118 DUMMY_AM_ENUM_ONE ,
103119 "Valid values are \"one\" and \"two\"." ,
104120 AccessExclusiveLock );
105- di_relopt_tab [3 ].optname = "option_enum" ;
106- di_relopt_tab [3 ].opttype = RELOPT_TYPE_ENUM ;
107- di_relopt_tab [3 ].offset = offsetof(DummyIndexOptions , option_enum );
121+ di_relopt_tab [5 ].optname = "option_enum" ;
122+ di_relopt_tab [5 ].opttype = RELOPT_TYPE_ENUM ;
123+ di_relopt_tab [5 ].offset = offsetof(DummyIndexOptions , option_enum );
108124
109125 add_string_reloption (di_relopt_kind , "option_string_val" ,
110126 "String option for dummy_index_am with non-NULL default" ,
111127 "DefaultValue" , & validate_string_option ,
112128 AccessExclusiveLock );
113- di_relopt_tab [4 ].optname = "option_string_val" ;
114- di_relopt_tab [4 ].opttype = RELOPT_TYPE_STRING ;
115- di_relopt_tab [4 ].offset = offsetof(DummyIndexOptions ,
129+ di_relopt_tab [6 ].optname = "option_string_val" ;
130+ di_relopt_tab [6 ].opttype = RELOPT_TYPE_STRING ;
131+ di_relopt_tab [6 ].offset = offsetof(DummyIndexOptions ,
116132 option_string_val_offset );
117133
118134 /*
@@ -123,9 +139,9 @@ create_reloptions_table(void)
123139 NULL , /* description */
124140 NULL , & validate_string_option ,
125141 AccessExclusiveLock );
126- di_relopt_tab [5 ].optname = "option_string_null" ;
127- di_relopt_tab [5 ].opttype = RELOPT_TYPE_STRING ;
128- di_relopt_tab [5 ].offset = offsetof(DummyIndexOptions ,
142+ di_relopt_tab [7 ].optname = "option_string_null" ;
143+ di_relopt_tab [7 ].opttype = RELOPT_TYPE_STRING ;
144+ di_relopt_tab [7 ].offset = offsetof(DummyIndexOptions ,
129145 option_string_null_offset );
130146}
131147
0 commit comments