|
7 | 7 | *
|
8 | 8 | *
|
9 | 9 | * IDENTIFICATION
|
10 |
| - * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteManip.c,v 1.57 2001/04/18 20:42:55 tgl Exp $ |
| 10 | + * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteManip.c,v 1.58 2001/09/07 20:52:31 tgl Exp $ |
11 | 11 | *
|
12 | 12 | *-------------------------------------------------------------------------
|
13 | 13 | */
|
@@ -592,15 +592,21 @@ AddQual(Query *parsetree, Node *qual)
|
592 | 592 |
|
593 | 593 | if (parsetree->commandType == CMD_UTILITY)
|
594 | 594 | {
|
595 |
| - |
596 | 595 | /*
|
597 |
| - * Noplace to put the qual on a utility statement. |
| 596 | + * There's noplace to put the qual on a utility statement. |
| 597 | + * |
| 598 | + * If it's a NOTIFY, silently ignore the qual; this means that the |
| 599 | + * NOTIFY will execute, whether or not there are any qualifying rows. |
| 600 | + * While clearly wrong, this is much more useful than refusing to |
| 601 | + * execute the rule at all, and extra NOTIFY events are harmless for |
| 602 | + * typical uses of NOTIFY. |
598 | 603 | *
|
599 |
| - * For now, we expect utility stmt to be a NOTIFY, so give a specific |
600 |
| - * error message for that case. |
| 604 | + * If it isn't a NOTIFY, error out, since unconditional execution |
| 605 | + * of other utility stmts is unlikely to be wanted. (This case is |
| 606 | + * not currently allowed anyway, but keep the test for safety.) |
601 | 607 | */
|
602 | 608 | if (parsetree->utilityStmt && IsA(parsetree->utilityStmt, NotifyStmt))
|
603 |
| - elog(ERROR, "Conditional NOTIFY is not implemented"); |
| 609 | + return; |
604 | 610 | else
|
605 | 611 | elog(ERROR, "Conditional utility statements are not implemented");
|
606 | 612 | }
|
@@ -634,15 +640,13 @@ AddHavingQual(Query *parsetree, Node *havingQual)
|
634 | 640 |
|
635 | 641 | if (parsetree->commandType == CMD_UTILITY)
|
636 | 642 | {
|
637 |
| - |
638 | 643 | /*
|
639 |
| - * Noplace to put the qual on a utility statement. |
| 644 | + * There's noplace to put the qual on a utility statement. |
640 | 645 | *
|
641 |
| - * For now, we expect utility stmt to be a NOTIFY, so give a specific |
642 |
| - * error message for that case. |
| 646 | + * See comments in AddQual for motivation. |
643 | 647 | */
|
644 | 648 | if (parsetree->utilityStmt && IsA(parsetree->utilityStmt, NotifyStmt))
|
645 |
| - elog(ERROR, "Conditional NOTIFY is not implemented"); |
| 649 | + return; |
646 | 650 | else
|
647 | 651 | elog(ERROR, "Conditional utility statements are not implemented");
|
648 | 652 | }
|
|
0 commit comments