Re: [PATCH] fix two shadow vars (src/backend/commands/sequence.c)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] fix two shadow vars (src/backend/commands/sequence.c)
Date: 2020-06-11 22:54:02
Message-ID: 579974.1591916042@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ranier Vilela <ranier(dot)vf(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-06-11 23:22:32 exp() versus the POSIX standard
Previous Message Bruce Momjian 2020-06-11 22:51:33 Re: [PATCH] Leading minus for negative time interval in ISO 8601