Commit febd60bf authored by Tom Lane's avatar Tom Lane

Fix pg_wchar_table[] to match revised ordering of the encoding ID enum.

Add some comments so hopefully the next poor sod doesn't fall into the
same trap.  (Wrong comments are worse than none at all...)
parent 4b21d1f0
......@@ -2,7 +2,7 @@
* Encoding names and routines for work with it. All
* in this file is shared bedween FE and BE.
*
* $PostgreSQL: pgsql/src/backend/utils/mb/encnames.c,v 1.35 2007/10/13 20:18:41 tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/mb/encnames.c,v 1.36 2007/10/15 22:46:27 tgl Exp $
*/
#ifdef FRONTEND
#include "postgres_fe.h"
......@@ -294,7 +294,7 @@ sizeof(pg_encname_tbl) / sizeof(pg_encname_tbl[0]) - 1;
/* ----------
* These are "official" encoding names.
* XXX must be sorted by the same order as pg_enc type (see mb/pg_wchar.h)
* XXX must be sorted by the same order as enum pg_enc (in mb/pg_wchar.h)
* ----------
*/
pg_enc2name pg_enc2name_tbl[] =
......
This diff is collapsed.
......@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/mb/pg_wchar.h,v 1.74 2007/10/13 20:18:41 tgl Exp $
* $PostgreSQL: pgsql/src/include/mb/pg_wchar.h,v 1.75 2007/10/15 22:46:27 tgl Exp $
*
* NOTES
* This is used both by the backend and by libpq, but should not be
......@@ -152,8 +152,9 @@ typedef unsigned int pg_wchar;
/*
* PostgreSQL encoding identifiers
*
* WARNING: the order of this table must be same as order
* in the pg_enc2name[] (mb/encnames.c) array!
* WARNING: the order of this enum must be same as order of entries
* in the pg_enc2name_tbl[] array (in mb/encnames.c), and
* in the pg_wchar_table[] array (in mb/wchar.c)!
*
* If you add some encoding don't forget to check
* PG_ENCODING_BE_LAST macro.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment