@@ -2721,13 +2721,15 @@ get_connect_string(const char *servername)
2721
2721
ForeignServer * foreign_server = NULL ;
2722
2722
UserMapping * user_mapping ;
2723
2723
ListCell * cell ;
2724
- StringInfo buf = makeStringInfo () ;
2724
+ StringInfoData buf ;
2725
2725
ForeignDataWrapper * fdw ;
2726
2726
AclResult aclresult ;
2727
2727
char * srvname ;
2728
2728
2729
2729
static const PQconninfoOption * options = NULL ;
2730
2730
2731
+ initStringInfo (& buf );
2732
+
2731
2733
/*
2732
2734
* Get list of valid libpq options.
2733
2735
*
@@ -2769,7 +2771,7 @@ get_connect_string(const char *servername)
2769
2771
DefElem * def = lfirst (cell );
2770
2772
2771
2773
if (is_valid_dblink_option (options , def -> defname , ForeignDataWrapperRelationId ))
2772
- appendStringInfo (buf , "%s='%s' " , def -> defname ,
2774
+ appendStringInfo (& buf , "%s='%s' " , def -> defname ,
2773
2775
escape_param_str (strVal (def -> arg )));
2774
2776
}
2775
2777
@@ -2778,7 +2780,7 @@ get_connect_string(const char *servername)
2778
2780
DefElem * def = lfirst (cell );
2779
2781
2780
2782
if (is_valid_dblink_option (options , def -> defname , ForeignServerRelationId ))
2781
- appendStringInfo (buf , "%s='%s' " , def -> defname ,
2783
+ appendStringInfo (& buf , "%s='%s' " , def -> defname ,
2782
2784
escape_param_str (strVal (def -> arg )));
2783
2785
}
2784
2786
@@ -2788,11 +2790,11 @@ get_connect_string(const char *servername)
2788
2790
DefElem * def = lfirst (cell );
2789
2791
2790
2792
if (is_valid_dblink_option (options , def -> defname , UserMappingRelationId ))
2791
- appendStringInfo (buf , "%s='%s' " , def -> defname ,
2793
+ appendStringInfo (& buf , "%s='%s' " , def -> defname ,
2792
2794
escape_param_str (strVal (def -> arg )));
2793
2795
}
2794
2796
2795
- return buf -> data ;
2797
+ return buf . data ;
2796
2798
}
2797
2799
else
2798
2800
return NULL ;
@@ -2807,16 +2809,18 @@ static char *
2807
2809
escape_param_str (const char * str )
2808
2810
{
2809
2811
const char * cp ;
2810
- StringInfo buf = makeStringInfo ();
2812
+ StringInfoData buf ;
2813
+
2814
+ initStringInfo (& buf );
2811
2815
2812
2816
for (cp = str ; * cp ; cp ++ )
2813
2817
{
2814
2818
if (* cp == '\\' || * cp == '\'' )
2815
- appendStringInfoChar (buf , '\\' );
2816
- appendStringInfoChar (buf , * cp );
2819
+ appendStringInfoChar (& buf , '\\' );
2820
+ appendStringInfoChar (& buf , * cp );
2817
2821
}
2818
2822
2819
- return buf -> data ;
2823
+ return buf . data ;
2820
2824
}
2821
2825
2822
2826
/*
0 commit comments