*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteHandler.c,v 1.86 2000/12/07 01:22:25 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteHandler.c,v 1.87 2001/01/03 22:01:05 tgl Exp $
*
*-------------------------------------------------------------------------
*/
* Note that if the rule refers to OLD, its jointree will add back
* a reference to rt_index.
*/
+ if (sub_action->jointree != NULL)
{
bool found;
List *newjointree = adjustJoinTreeList(parsetree,
* back to source text
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.70 2000/11/18 04:40:18 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.71 2001/01/03 22:01:05 tgl Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
static void get_insert_query_def(Query *query, deparse_context *context);
static void get_update_query_def(Query *query, deparse_context *context);
static void get_delete_query_def(Query *query, deparse_context *context);
+static void get_utility_query_def(Query *query, deparse_context *context);
static void get_basic_select_query(Query *query, deparse_context *context);
static void get_setop_query(Node *setOp, Query *query,
deparse_context *context, bool toplevel);
appendStringInfo(buf, "NOTHING");
break;
+ case CMD_UTILITY:
+ get_utility_query_def(query, &context);
+ break;
+
default:
elog(ERROR, "get_ruledef of %s: query command type %d not implemented yet",
rulename, query->commandType);
}
}
+
+/* ----------
+ * get_utility_query_def - Parse back a UTILITY parsetree
+ * ----------
+ */
+static void
+get_utility_query_def(Query *query, deparse_context *context)
+{
+ StringInfo buf = context->buf;
+
+ if (query->utilityStmt && IsA(query->utilityStmt, NotifyStmt))
+ {
+ NotifyStmt *stmt = (NotifyStmt *) query->utilityStmt;
+ appendStringInfo(buf, "NOTIFY %s", quote_identifier(stmt->relname));
+ }
+ else
+ elog(ERROR, "get_utility_query_def: unexpected statement type");
+}
+
+
/*
* Find the RTE referenced by a (possibly nonlocal) Var.
*/