|
3 | 3 | *back to source text
|
4 | 4 | *
|
5 | 5 | * IDENTIFICATION
|
6 |
| - * $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.70 2000/11/18 04:40:18 tgl Exp $ |
| 6 | + * $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.71 2001/01/03 22:01:05 tgl Exp $ |
7 | 7 | *
|
8 | 8 | * This software is copyrighted by Jan Wieck - Hamburg.
|
9 | 9 | *
|
@@ -97,6 +97,7 @@ static void get_select_query_def(Query *query, deparse_context *context);
|
97 | 97 | staticvoidget_insert_query_def(Query*query,deparse_context*context);
|
98 | 98 | staticvoidget_update_query_def(Query*query,deparse_context*context);
|
99 | 99 | staticvoidget_delete_query_def(Query*query,deparse_context*context);
|
| 100 | +staticvoidget_utility_query_def(Query*query,deparse_context*context); |
100 | 101 | staticvoidget_basic_select_query(Query*query,deparse_context*context);
|
101 | 102 | staticvoidget_setop_query(Node*setOp,Query*query,
|
102 | 103 | deparse_context*context,booltoplevel);
|
@@ -874,6 +875,10 @@ get_query_def(Query *query, StringInfo buf, List *parentrtables)
|
874 | 875 | appendStringInfo(buf,"NOTHING");
|
875 | 876 | break;
|
876 | 877 |
|
| 878 | +caseCMD_UTILITY: |
| 879 | +get_utility_query_def(query,&context); |
| 880 | +break; |
| 881 | + |
877 | 882 | default:
|
878 | 883 | elog(ERROR,"get_ruledef of %s: query command type %d not implemented yet",
|
879 | 884 | rulename,query->commandType);
|
@@ -1310,6 +1315,26 @@ get_delete_query_def(Query *query, deparse_context *context)
|
1310 | 1315 | }
|
1311 | 1316 | }
|
1312 | 1317 |
|
| 1318 | + |
| 1319 | +/* ---------- |
| 1320 | + * get_utility_query_def- Parse back a UTILITY parsetree |
| 1321 | + * ---------- |
| 1322 | + */ |
| 1323 | +staticvoid |
| 1324 | +get_utility_query_def(Query*query,deparse_context*context) |
| 1325 | +{ |
| 1326 | +StringInfobuf=context->buf; |
| 1327 | + |
| 1328 | +if (query->utilityStmt&&IsA(query->utilityStmt,NotifyStmt)) |
| 1329 | +{ |
| 1330 | +NotifyStmt*stmt= (NotifyStmt*)query->utilityStmt; |
| 1331 | +appendStringInfo(buf,"NOTIFY %s",quote_identifier(stmt->relname)); |
| 1332 | +} |
| 1333 | +else |
| 1334 | +elog(ERROR,"get_utility_query_def: unexpected statement type"); |
| 1335 | +} |
| 1336 | + |
| 1337 | + |
1313 | 1338 | /*
|
1314 | 1339 | * Find the RTE referenced by a (possibly nonlocal) Var.
|
1315 | 1340 | */
|
|