@@ -388,9 +388,9 @@ AppendSeconds(char *cp, int sec, fsec_t fsec, int precision, bool fillzeros)
388388Assert (precision >=0 );
389389
390390if (fillzeros )
391- cp = pg_ltostr_zeropad (cp ,Abs (sec ),2 );
391+ cp = pg_ultostr_zeropad (cp ,Abs (sec ),2 );
392392else
393- cp = pg_ltostr (cp ,Abs (sec ));
393+ cp = pg_ultostr (cp ,Abs (sec ));
394394
395395/* fsec_t is just an int32 */
396396if (fsec != 0 )
@@ -430,7 +430,7 @@ AppendSeconds(char *cp, int sec, fsec_t fsec, int precision, bool fillzeros)
430430 * which will generate a correct answer in the minimum valid width.
431431 */
432432if (value )
433- return pg_ltostr (cp ,Abs (fsec ));
433+ return pg_ultostr (cp ,Abs (fsec ));
434434
435435return end ;
436436}
@@ -3831,20 +3831,20 @@ EncodeTimezone(char *str, int tz, int style)
38313831
38323832if (sec != 0 )
38333833{
3834- str = pg_ltostr_zeropad (str ,hour ,2 );
3834+ str = pg_ultostr_zeropad (str ,hour ,2 );
38353835* str ++ = ':' ;
3836- str = pg_ltostr_zeropad (str ,min ,2 );
3836+ str = pg_ultostr_zeropad (str ,min ,2 );
38373837* str ++ = ':' ;
3838- str = pg_ltostr_zeropad (str ,sec ,2 );
3838+ str = pg_ultostr_zeropad (str ,sec ,2 );
38393839}
38403840else if (min != 0 || style == USE_XSD_DATES )
38413841{
3842- str = pg_ltostr_zeropad (str ,hour ,2 );
3842+ str = pg_ultostr_zeropad (str ,hour ,2 );
38433843* str ++ = ':' ;
3844- str = pg_ltostr_zeropad (str ,min ,2 );
3844+ str = pg_ultostr_zeropad (str ,min ,2 );
38453845}
38463846else
3847- str = pg_ltostr_zeropad (str ,hour ,2 );
3847+ str = pg_ultostr_zeropad (str ,hour ,2 );
38483848return str ;
38493849}
38503850
@@ -3861,40 +3861,40 @@ EncodeDateOnly(struct pg_tm *tm, int style, char *str)
38613861case USE_ISO_DATES :
38623862case USE_XSD_DATES :
38633863/* compatible with ISO date formats */
3864- str = pg_ltostr_zeropad (str ,
3864+ str = pg_ultostr_zeropad (str ,
38653865(tm -> tm_year > 0 ) ?tm -> tm_year :- (tm -> tm_year - 1 ),4 );
38663866* str ++ = '-' ;
3867- str = pg_ltostr_zeropad (str ,tm -> tm_mon ,2 );
3867+ str = pg_ultostr_zeropad (str ,tm -> tm_mon ,2 );
38683868* str ++ = '-' ;
3869- str = pg_ltostr_zeropad (str ,tm -> tm_mday ,2 );
3869+ str = pg_ultostr_zeropad (str ,tm -> tm_mday ,2 );
38703870break ;
38713871
38723872case USE_SQL_DATES :
38733873/* compatible with Oracle/Ingres date formats */
38743874if (DateOrder == DATEORDER_DMY )
38753875{
3876- str = pg_ltostr_zeropad (str ,tm -> tm_mday ,2 );
3876+ str = pg_ultostr_zeropad (str ,tm -> tm_mday ,2 );
38773877* str ++ = '/' ;
3878- str = pg_ltostr_zeropad (str ,tm -> tm_mon ,2 );
3878+ str = pg_ultostr_zeropad (str ,tm -> tm_mon ,2 );
38793879}
38803880else
38813881{
3882- str = pg_ltostr_zeropad (str ,tm -> tm_mon ,2 );
3882+ str = pg_ultostr_zeropad (str ,tm -> tm_mon ,2 );
38833883* str ++ = '/' ;
3884- str = pg_ltostr_zeropad (str ,tm -> tm_mday ,2 );
3884+ str = pg_ultostr_zeropad (str ,tm -> tm_mday ,2 );
38853885}
38863886* str ++ = '/' ;
3887- str = pg_ltostr_zeropad (str ,
3887+ str = pg_ultostr_zeropad (str ,
38883888(tm -> tm_year > 0 ) ?tm -> tm_year :- (tm -> tm_year - 1 ),4 );
38893889break ;
38903890
38913891case USE_GERMAN_DATES :
38923892/* German-style date format */
3893- str = pg_ltostr_zeropad (str ,tm -> tm_mday ,2 );
3893+ str = pg_ultostr_zeropad (str ,tm -> tm_mday ,2 );
38943894* str ++ = '.' ;
3895- str = pg_ltostr_zeropad (str ,tm -> tm_mon ,2 );
3895+ str = pg_ultostr_zeropad (str ,tm -> tm_mon ,2 );
38963896* str ++ = '.' ;
3897- str = pg_ltostr_zeropad (str ,
3897+ str = pg_ultostr_zeropad (str ,
38983898(tm -> tm_year > 0 ) ?tm -> tm_year :- (tm -> tm_year - 1 ),4 );
38993899break ;
39003900
@@ -3903,18 +3903,18 @@ EncodeDateOnly(struct pg_tm *tm, int style, char *str)
39033903/* traditional date-only style for Postgres */
39043904if (DateOrder == DATEORDER_DMY )
39053905{
3906- str = pg_ltostr_zeropad (str ,tm -> tm_mday ,2 );
3906+ str = pg_ultostr_zeropad (str ,tm -> tm_mday ,2 );
39073907* str ++ = '-' ;
3908- str = pg_ltostr_zeropad (str ,tm -> tm_mon ,2 );
3908+ str = pg_ultostr_zeropad (str ,tm -> tm_mon ,2 );
39093909}
39103910else
39113911{
3912- str = pg_ltostr_zeropad (str ,tm -> tm_mon ,2 );
3912+ str = pg_ultostr_zeropad (str ,tm -> tm_mon ,2 );
39133913* str ++ = '-' ;
3914- str = pg_ltostr_zeropad (str ,tm -> tm_mday ,2 );
3914+ str = pg_ultostr_zeropad (str ,tm -> tm_mday ,2 );
39153915}
39163916* str ++ = '-' ;
3917- str = pg_ltostr_zeropad (str ,
3917+ str = pg_ultostr_zeropad (str ,
39183918(tm -> tm_year > 0 ) ?tm -> tm_year :- (tm -> tm_year - 1 ),4 );
39193919break ;
39203920}
@@ -3939,9 +3939,9 @@ EncodeDateOnly(struct pg_tm *tm, int style, char *str)
39393939void
39403940EncodeTimeOnly (struct pg_tm * tm ,fsec_t fsec ,bool print_tz ,int tz ,int style ,char * str )
39413941{
3942- str = pg_ltostr_zeropad (str ,tm -> tm_hour ,2 );
3942+ str = pg_ultostr_zeropad (str ,tm -> tm_hour ,2 );
39433943* str ++ = ':' ;
3944- str = pg_ltostr_zeropad (str ,tm -> tm_min ,2 );
3944+ str = pg_ultostr_zeropad (str ,tm -> tm_min ,2 );
39453945* str ++ = ':' ;
39463946str = AppendSeconds (str ,tm -> tm_sec ,fsec ,MAX_TIME_PRECISION , true);
39473947if (print_tz )
@@ -3984,16 +3984,16 @@ EncodeDateTime(struct pg_tm *tm, fsec_t fsec, bool print_tz, int tz, const char
39843984case USE_ISO_DATES :
39853985case USE_XSD_DATES :
39863986/* Compatible with ISO-8601 date formats */
3987- str = pg_ltostr_zeropad (str ,
3987+ str = pg_ultostr_zeropad (str ,
39883988(tm -> tm_year > 0 ) ?tm -> tm_year :- (tm -> tm_year - 1 ),4 );
39893989* str ++ = '-' ;
3990- str = pg_ltostr_zeropad (str ,tm -> tm_mon ,2 );
3990+ str = pg_ultostr_zeropad (str ,tm -> tm_mon ,2 );
39913991* str ++ = '-' ;
3992- str = pg_ltostr_zeropad (str ,tm -> tm_mday ,2 );
3992+ str = pg_ultostr_zeropad (str ,tm -> tm_mday ,2 );
39933993* str ++ = (style == USE_ISO_DATES ) ?' ' :'T' ;
3994- str = pg_ltostr_zeropad (str ,tm -> tm_hour ,2 );
3994+ str = pg_ultostr_zeropad (str ,tm -> tm_hour ,2 );
39953995* str ++ = ':' ;
3996- str = pg_ltostr_zeropad (str ,tm -> tm_min ,2 );
3996+ str = pg_ultostr_zeropad (str ,tm -> tm_min ,2 );
39973997* str ++ = ':' ;
39983998str = AppendTimestampSeconds (str ,tm ,fsec );
39993999if (print_tz )
@@ -4004,23 +4004,23 @@ EncodeDateTime(struct pg_tm *tm, fsec_t fsec, bool print_tz, int tz, const char
40044004/* Compatible with Oracle/Ingres date formats */
40054005if (DateOrder == DATEORDER_DMY )
40064006{
4007- str = pg_ltostr_zeropad (str ,tm -> tm_mday ,2 );
4007+ str = pg_ultostr_zeropad (str ,tm -> tm_mday ,2 );
40084008* str ++ = '/' ;
4009- str = pg_ltostr_zeropad (str ,tm -> tm_mon ,2 );
4009+ str = pg_ultostr_zeropad (str ,tm -> tm_mon ,2 );
40104010}
40114011else
40124012{
4013- str = pg_ltostr_zeropad (str ,tm -> tm_mon ,2 );
4013+ str = pg_ultostr_zeropad (str ,tm -> tm_mon ,2 );
40144014* str ++ = '/' ;
4015- str = pg_ltostr_zeropad (str ,tm -> tm_mday ,2 );
4015+ str = pg_ultostr_zeropad (str ,tm -> tm_mday ,2 );
40164016}
40174017* str ++ = '/' ;
4018- str = pg_ltostr_zeropad (str ,
4018+ str = pg_ultostr_zeropad (str ,
40194019(tm -> tm_year > 0 ) ?tm -> tm_year :- (tm -> tm_year - 1 ),4 );
40204020* str ++ = ' ' ;
4021- str = pg_ltostr_zeropad (str ,tm -> tm_hour ,2 );
4021+ str = pg_ultostr_zeropad (str ,tm -> tm_hour ,2 );
40224022* str ++ = ':' ;
4023- str = pg_ltostr_zeropad (str ,tm -> tm_min ,2 );
4023+ str = pg_ultostr_zeropad (str ,tm -> tm_min ,2 );
40244024* str ++ = ':' ;
40254025str = AppendTimestampSeconds (str ,tm ,fsec );
40264026
@@ -4043,16 +4043,16 @@ EncodeDateTime(struct pg_tm *tm, fsec_t fsec, bool print_tz, int tz, const char
40434043
40444044case USE_GERMAN_DATES :
40454045/* German variant on European style */
4046- str = pg_ltostr_zeropad (str ,tm -> tm_mday ,2 );
4046+ str = pg_ultostr_zeropad (str ,tm -> tm_mday ,2 );
40474047* str ++ = '.' ;
4048- str = pg_ltostr_zeropad (str ,tm -> tm_mon ,2 );
4048+ str = pg_ultostr_zeropad (str ,tm -> tm_mon ,2 );
40494049* str ++ = '.' ;
4050- str = pg_ltostr_zeropad (str ,
4050+ str = pg_ultostr_zeropad (str ,
40514051(tm -> tm_year > 0 ) ?tm -> tm_year :- (tm -> tm_year - 1 ),4 );
40524052* str ++ = ' ' ;
4053- str = pg_ltostr_zeropad (str ,tm -> tm_hour ,2 );
4053+ str = pg_ultostr_zeropad (str ,tm -> tm_hour ,2 );
40544054* str ++ = ':' ;
4055- str = pg_ltostr_zeropad (str ,tm -> tm_min ,2 );
4055+ str = pg_ultostr_zeropad (str ,tm -> tm_min ,2 );
40564056* str ++ = ':' ;
40574057str = AppendTimestampSeconds (str ,tm ,fsec );
40584058
@@ -4078,7 +4078,7 @@ EncodeDateTime(struct pg_tm *tm, fsec_t fsec, bool print_tz, int tz, const char
40784078* str ++ = ' ' ;
40794079if (DateOrder == DATEORDER_DMY )
40804080{
4081- str = pg_ltostr_zeropad (str ,tm -> tm_mday ,2 );
4081+ str = pg_ultostr_zeropad (str ,tm -> tm_mday ,2 );
40824082* str ++ = ' ' ;
40834083memcpy (str ,months [tm -> tm_mon - 1 ],3 );
40844084str += 3 ;
@@ -4088,16 +4088,16 @@ EncodeDateTime(struct pg_tm *tm, fsec_t fsec, bool print_tz, int tz, const char
40884088memcpy (str ,months [tm -> tm_mon - 1 ],3 );
40894089str += 3 ;
40904090* str ++ = ' ' ;
4091- str = pg_ltostr_zeropad (str ,tm -> tm_mday ,2 );
4091+ str = pg_ultostr_zeropad (str ,tm -> tm_mday ,2 );
40924092}
40934093* str ++ = ' ' ;
4094- str = pg_ltostr_zeropad (str ,tm -> tm_hour ,2 );
4094+ str = pg_ultostr_zeropad (str ,tm -> tm_hour ,2 );
40954095* str ++ = ':' ;
4096- str = pg_ltostr_zeropad (str ,tm -> tm_min ,2 );
4096+ str = pg_ultostr_zeropad (str ,tm -> tm_min ,2 );
40974097* str ++ = ':' ;
40984098str = AppendTimestampSeconds (str ,tm ,fsec );
40994099* str ++ = ' ' ;
4100- str = pg_ltostr_zeropad (str ,
4100+ str = pg_ultostr_zeropad (str ,
41014101(tm -> tm_year > 0 ) ?tm -> tm_year :- (tm -> tm_year - 1 ),4 );
41024102
41034103if (print_tz )