}
-static JoinPath *
-flatCopyJoinPath(JoinPath *pathnode)
-{
- JoinPath *newnode;
- size_t size = 0;
- switch(nodeTag(pathnode))
- {
- case T_NestPath:
- size = sizeof(NestPath);
- break;
- case T_MergePath:
- size = sizeof(MergePath);
- break;
- case T_HashPath:
- size = sizeof(HashPath);
- break;
- default:
- elog(ERROR, "unrecognized node type: %d", (int) nodeTag(pathnode));
- break;
- }
- newnode = (JoinPath *) palloc(size);
- memcpy(newnode, pathnode, size);
- return newnode;
-}
-
-
/*
* Analyze join parameters and set distribution of the join node.
* If there are possible alternate distributions the respective pathes are
/* Forbid unsafe SQL statements */
bool StrictStatementChecking = true;
-static void validate_part_col_updatable(const Query *query);
static bool contains_temp_tables(List *rtable);
static PlannedStmt *pgxc_FQS_planner(Query *query, ParamListInfo boundParams);
static RemoteQuery *pgxc_FQS_create_remote_plan(Query *query,
return query_step;
}
-
-/*
- * validate whether partition column of a table is being updated
- */
-static void
-validate_part_col_updatable(const Query *query)
-{
- RangeTblEntry *rte;
- RelationLocInfo *rel_loc_info;
- ListCell *lc;
-
- /* Make sure there is one table at least */
- if (query->rtable == NULL)
- return;
-
- rte = (RangeTblEntry *) list_nth(query->rtable, query->resultRelation - 1);
-
-
- if (rte != NULL && rte->relkind != RELKIND_RELATION)
- /* Bad relation type */
- return;
-
- /* See if we have the partitioned case. */
- rel_loc_info = GetRelationLocInfo(rte->relid);
-
- /* Any column updation on local relations is fine */
- if (!rel_loc_info)
- return;
-
- /* Only relations distributed by value can be checked */
- if (IsRelationDistributedByValue(rel_loc_info))
- {
- /* It is a partitioned table, check partition column in targetList */
- foreach(lc, query->targetList)
- {
- TargetEntry *tle = (TargetEntry *) lfirst(lc);
-
- /* Nothing to do for a junk entry */
- if (tle->resjunk)
- continue;
-
- /*
- * See if we have a constant expression comparing against the
- * designated partitioned column
- */
- if (strcmp(tle->resname, GetRelationDistribColumn(rel_loc_info)) == 0)
- ereport(ERROR,
- (errcode(ERRCODE_INVALID_COLUMN_REFERENCE),
- (errmsg("Partition column can't be updated in current version"))));
- }
- }
-}
-
static void setup_privileges(void);
static void set_info_version(void);
static void setup_schema(void);
-#ifdef XCP
-static void setup_storm(void);
-#endif
static void load_plpgsql(void);
static void vacuum_db(void);
static void make_template0(void);
check_ok();
}
-#ifdef XCP
-/*
- * load storm catalog and populate from features file
- */
-static void
-setup_storm(void)
-{
- PG_CMD_DECL;
- char **line;
- char **lines;
-
- fputs(_("creating storm catalog... "), stdout);
- fflush(stdout);
-
- lines = readfile(storm_cat_file);
-
- /*
- * We use -j here to avoid backslashing stuff in storm_catalog.sql
- */
- snprintf(cmd, sizeof(cmd),
- "\"%s\" %s -j template1 >%s",
- backend_exec, backend_options,
- DEVNULL);
-
- PG_CMD_OPEN;
-
- for (line = lines; *line != NULL; line++)
- {
- PG_CMD_PUTS(*line);
- free(*line);
- }
-
- free(lines);
-
- PG_CMD_CLOSE;
-
- check_ok();
-}
-#endif
-
/*
* load PL/pgsql server-side language
*/
static void GTMProxy_ProxyCommand(GTMProxy_ConnectionInfo *conninfo,
GTM_Conn *gtm_conn, GTM_MessageType mtype, StringInfo message);
-static void GTMProxy_ProxyPGXCNodeCommand(GTMProxy_ConnectionInfo *conninfo,
- GTM_Conn *gtm_conn, GTM_MessageType mtype, GTMProxy_CommandData cmd_data);
static void ProcessCommand(GTMProxy_ConnectionInfo *conninfo,
GTM_Conn *gtm_conn, StringInfo input_message);