@@ -1079,7 +1079,7 @@ ngx_postgres_conf_set(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
1079
1079
1080
1080
pgvar -> idx = pglcf -> variables -> nelts - 1 ;
1081
1081
1082
- pgvar -> var = ngx_http_add_variable (cf , & value [1 ], 0 );
1082
+ pgvar -> var = ngx_http_add_variable (cf , & value [1 ], NGX_HTTP_VAR_CHANGEABLE );
1083
1083
if (pgvar -> var == NULL ) {
1084
1084
dd ("returning NGX_CONF_ERROR" );
1085
1085
return NGX_CONF_ERROR ;
@@ -1091,22 +1091,11 @@ ngx_postgres_conf_set(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
1091
1091
return NGX_CONF_ERROR ;
1092
1092
}
1093
1093
1094
- /*
1095
- * Check if "$variable" was previously defined,
1096
- * back-off even if it was marked as "CHANGEABLE".
1097
- */
1098
- if (pgvar -> var -> get_handler != NULL ) {
1099
- ngx_conf_log_error (NGX_LOG_EMERG , cf , 0 ,
1100
- "postgres: variable \"$%V\" is duplicate"
1101
- " in \"%V\" directive" , & value [1 ], & cmd -> name );
1102
-
1103
- dd ("returning NGX_CONF_ERROR" );
1104
- return NGX_CONF_ERROR ;
1094
+ if (pgvar -> var -> get_handler == NULL ) {
1095
+ pgvar -> var -> get_handler = ngx_postgres_variable_get_custom ;
1096
+ pgvar -> var -> data = (uintptr_t ) pgvar ;
1105
1097
}
1106
1098
1107
- pgvar -> var -> get_handler = ngx_postgres_variable_get_custom ;
1108
- pgvar -> var -> data = (uintptr_t ) pgvar ;
1109
-
1110
1099
pgvar -> value .row = ngx_atoi (value [2 ].data , value [2 ].len );
1111
1100
if (pgvar -> value .row == NGX_ERROR ) {
1112
1101
ngx_conf_log_error (NGX_LOG_EMERG , cf , 0 ,
0 commit comments