Re: [PATCH] fix two shadow vars (src/backend/commands/sequence.c) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCH] fix two shadow vars (src/backend/commands/sequence.c)
Date
Msg-id 579974.1591916042@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCH] fix two shadow vars (src/backend/commands/sequence.c)  (Ranier Vilela <ranier.vf@gmail.com>)
Responses Re: [PATCH] fix two shadow vars (src/backend/commands/sequence.c)  (Ranier Vilela <ranier.vf@gmail.com>)
List pgsql-hackers
Ranier Vilela <ranier.vf@gmail.com> writes:
> elog and errmsg_internal, permits use as proposed by the patch,
> does it mean that errmsg, does not allow and does not do the same job as
> snprintf?

Yes.  errmsg() strings are captured for translation.  If they contain
platform-dependent substrings, that's a problem, because only one variant
will get captured.  And INT64_FORMAT is platform-dependent.

We have of late decided that it's safe to use %lld (or %llu) to format
int64s everywhere, but you then have to cast the printf argument to
match that explicitly.  See commit 6a1cd8b92 for precedent.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [PATCH] Leading minus for negative time interval in ISO 8601
Next
From: Tom Lane
Date:
Subject: exp() versus the POSIX standard