summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2011-08-06 18:53:49 +0000
committerTom Lane2011-08-06 18:53:49 +0000
commit05e83968929f4ec1eba058fcae755fd2df98864e (patch)
tree7ffac5eb9aa9587d20a60d8fac592763f7ae7bac
parentffcf5a6c41ce91c55991b04eea1fcb94e4d0faa0 (diff)
Clean up ill-advised attempt to invent a private set of Node tags.
Somebody thought it'd be cute to invent a set of Node tag numbers that were defined independently of, and indeed conflicting with, the main tag-number list. While this accidentally failed to fail so far, it would certainly lead to trouble as soon as anyone wanted to, say, apply copyObject to these node types. Clang was already complaining about the use of makeNode on these tags, and I think quite rightly so. Fix by pushing these node definitions into the mainstream, including putting replnodes.h where it belongs.
-rw-r--r--src/backend/replication/repl_gram.y4
-rw-r--r--src/backend/replication/walsender.c6
-rw-r--r--src/include/nodes/nodes.h7
-rw-r--r--src/include/nodes/replnodes.h (renamed from src/include/replication/replnodes.h)14
-rw-r--r--src/include/replication/basebackup.h4
5 files changed, 16 insertions, 19 deletions
diff --git a/src/backend/replication/repl_gram.y b/src/backend/replication/repl_gram.y
index 4930ad1d09..d99708ca8e 100644
--- a/src/backend/replication/repl_gram.y
+++ b/src/backend/replication/repl_gram.y
@@ -16,10 +16,10 @@
#include "postgres.h"
#include "nodes/makefuncs.h"
-#include "nodes/parsenodes.h"
-#include "replication/replnodes.h"
+#include "nodes/replnodes.h"
#include "replication/walsender.h"
+
/* Result of the parsing is returned here */
Node *replication_parse_result;
diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c
index 63a63048db..7f83a32c0c 100644
--- a/src/backend/replication/walsender.c
+++ b/src/backend/replication/walsender.c
@@ -37,16 +37,16 @@
#include <signal.h>
#include <unistd.h>
-#include "funcapi.h"
-#include "access/xlog_internal.h"
#include "access/transam.h"
+#include "access/xlog_internal.h"
#include "catalog/pg_type.h"
+#include "funcapi.h"
#include "libpq/libpq.h"
#include "libpq/pqformat.h"
#include "libpq/pqsignal.h"
#include "miscadmin.h"
+#include "nodes/replnodes.h"
#include "replication/basebackup.h"
-#include "replication/replnodes.h"
#include "replication/walprotocol.h"
#include "replication/walreceiver.h"
#include "replication/walsender.h"
diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h
index d8bc6b8214..ecf62b335b 100644
--- a/src/include/nodes/nodes.h
+++ b/src/include/nodes/nodes.h
@@ -403,6 +403,13 @@ typedef enum NodeTag
T_CommonTableExpr,
/*
+ * TAGS FOR REPLICATION GRAMMAR PARSE NODES (replnodes.h)
+ */
+ T_IdentifySystemCmd,
+ T_BaseBackupCmd,
+ T_StartReplicationCmd,
+
+ /*
* TAGS FOR RANDOM OTHER STUFF
*
* These are objects that aren't part of parse/plan/execute node tree
diff --git a/src/include/replication/replnodes.h b/src/include/nodes/replnodes.h
index e027f9203b..8cbd18a24c 100644
--- a/src/include/replication/replnodes.h
+++ b/src/include/nodes/replnodes.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2011, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * src/include/replication/replnodes.h
+ * src/include/nodes/replnodes.h
*
*-------------------------------------------------------------------------
*/
@@ -15,18 +15,8 @@
#define REPLNODES_H
#include "access/xlogdefs.h"
-#include "nodes/primnodes.h"
-#include "nodes/value.h"
+#include "nodes/pg_list.h"
-/*
- * NodeTags for replication parser
- */
-typedef enum ReplNodeTag
-{
- T_IdentifySystemCmd = 10,
- T_BaseBackupCmd,
- T_StartReplicationCmd
-} ReplNodeTag;
/* ----------------------
* IDENTIFY_SYSTEM command
diff --git a/src/include/replication/basebackup.h b/src/include/replication/basebackup.h
index 831c33fb4a..7ce1f38372 100644
--- a/src/include/replication/basebackup.h
+++ b/src/include/replication/basebackup.h
@@ -5,14 +5,14 @@
*
* Portions Copyright (c) 2010-2011, PostgreSQL Global Development Group
*
- * src/include/replication/walsender.h
+ * src/include/replication/basebackup.h
*
*-------------------------------------------------------------------------
*/
#ifndef _BASEBACKUP_H
#define _BASEBACKUP_H
-#include "replication/replnodes.h"
+#include "nodes/replnodes.h"
extern void SendBaseBackup(BaseBackupCmd *cmd);