@@ -59,7 +59,7 @@ Datum csv_agg_transfn(PG_FUNCTION_ARGS) {
5959 TupleDesc tdesc =
6060 lookup_rowtype_tupdesc (HeapTupleHeaderGetTypeId (next ), HeapTupleHeaderGetTypMod (next ));
6161
62- if (state -> options -> with_bom ) appendBinaryStringInfo (& state -> accum_buf , BOM , sizeof (BOM ));
62+ if (state -> options -> bom ) appendBinaryStringInfo (& state -> accum_buf , BOM , sizeof (BOM ));
6363
6464 // build header row
6565 if (state -> options -> header ) {
@@ -69,10 +69,10 @@ Datum csv_agg_transfn(PG_FUNCTION_ARGS) {
6969 continue ;
7070
7171 if (i > 0 ) // only append delimiter after the first value
72- appendStringInfoChar (& state -> accum_buf , state -> options -> delim );
72+ appendStringInfoChar (& state -> accum_buf , state -> options -> delimiter );
7373
7474 char * cstr = NameStr (att -> attname );
75- csv_append_field (& state -> accum_buf , cstr , strlen (cstr ), state -> options -> delim );
75+ csv_append_field (& state -> accum_buf , cstr , strlen (cstr ), state -> options -> delimiter );
7676 }
7777
7878 appendStringInfoChar (& state -> accum_buf , NEWLINE );
@@ -107,12 +107,12 @@ Datum csv_agg_transfn(PG_FUNCTION_ARGS) {
107107 if (att -> attisdropped ) // pg always keeps dropped columns, guard against this
108108 continue ;
109109
110- if (i > 0 ) appendStringInfoChar (& state -> accum_buf , state -> options -> delim );
110+ if (i > 0 ) appendStringInfoChar (& state -> accum_buf , state -> options -> delimiter );
111111
112112 if (nulls [i ]) continue ; // empty field for NULL
113113
114114 char * cstr = datum_to_cstring (datums [i ], att -> atttypid );
115- csv_append_field (& state -> accum_buf , cstr , strlen (cstr ), state -> options -> delim );
115+ csv_append_field (& state -> accum_buf , cstr , strlen (cstr ), state -> options -> delimiter );
116116 }
117117
118118 PG_RETURN_POINTER (state );
0 commit comments