summaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/preproc/keywords.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/ecpg/preproc/keywords.c')
-rw-r--r--src/interfaces/ecpg/preproc/keywords.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/interfaces/ecpg/preproc/keywords.c b/src/interfaces/ecpg/preproc/keywords.c
index 2f17f0c5c02..cffdaed67b0 100644
--- a/src/interfaces/ecpg/preproc/keywords.c
+++ b/src/interfaces/ecpg/preproc/keywords.c
@@ -15,13 +15,23 @@
*/
#include "postgres_fe.h"
-#include "parser/keywords.h"
-#include "type.h"
+/*
+ * This is much trickier than it looks. We are #include'ing kwlist.h
+ * but the "value" numbers that go into the table are from preproc.h
+ * not the backend's gram.h. Therefore this table will recognize all
+ * keywords known to the backend, but will supply the token numbers used
+ * by ecpg's grammar, which is what we need. The ecpg grammar must
+ * define all the same token names the backend does, else we'll get
+ * undefined-symbol failures in this compile.
+ */
+
+#include "common/keywords.h"
+
#include "extern.h"
#include "preproc.h"
-#define PG_KEYWORD(a,b,c) {a,b,c},
+#define PG_KEYWORD(a,b,c) {a,b,c},
const ScanKeyword SQLScanKeywords[] = {
#include "parser/kwlist.h"