Bruce Momjian <bruce@momjian.us> writes:
> Also, what is the difference between _PG_LAST_ENCODING_, which is the
> last encoding enum, and the pg_wchar_tbl length calculation? Are they
> the same?
They certainly should be; I don't think it's the responsibility of these
functions to defend against them not being so.
> If so, we should just use _PG_LAST_ENCODING_.
Well, we should use PG_VALID_ENCODING() imo.
regards, tom lane