Re: BUG #15511: Drop table error "invalid argument"

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: ertugrul9090(at)gmail(dot)com, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15511: Drop table error "invalid argument"
Date: 2018-12-06 23:38:21
Message-ID: 3314.1544139501@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

... so my preliminary result is that there's a *boatload* of "invalid"
format strings in our translation files, all of them apparently with
the extra-space disease. See attached.

While it looks like every one of these is a typo, I'm beginning to
have second thoughts about the premise here. Presumably, the reason
we've not noticed this issue before is that almost all non-Windows
platforms were using libc's printf, which is going to implement the
full set of POSIX-specified flags including space. As of HEAD that
is no longer the case, because we use snprintf.c everywhere. While
it might not be a problem for our own code if snprintf.c is a couple
of flags short of full POSIX, I'm worrying that third-party code
might be unhappy if *printf in the PG environment behaves oddly.

So maybe the best compromise is to upgrade snprintf.c. I think it'd
only take a few more lines to implement the space flag per spec.
The other flags that we aren't implementing are '#' ("alternate form")
and "'" (thousands grouping). For those, I'd be a bit inclined to accept
them but treat 'em as no-ops. On the other hand, that still leaves
some daylight between us and POSIX, in the form of stuff like "long
double" support, and I still don't want to go near that.

Thoughts?

For the archives' sake, I attach the code I used for this.
I'm now thinking maybe we wouldn't commit it, though.

regards, tom lane

Attachment Content-Type Size
scan-results text/plain 12.3 KB
test-po-files.patch text/x-diff 7.7 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2018-12-07 07:01:38 BUG #15538: Postgres query performance is slow.
Previous Message Tom Lane 2018-12-06 21:08:14 Re: BUG #15511: Drop table error "invalid argument"