|
9 | 9 | *
|
10 | 10 | *
|
11 | 11 | * IDENTIFICATION
|
12 |
| - * $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.319 2010/01/17 22:56:22 tgl Exp $ |
| 12 | + * $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.320 2010/01/21 06:11:45 itagaki Exp $ |
13 | 13 | *
|
14 | 14 | *-------------------------------------------------------------------------
|
15 | 15 | */
|
@@ -518,10 +518,9 @@ pg_get_triggerdef_worker(Oid trigid, bool pretty)
|
518 | 518 | initStringInfo(&buf);
|
519 | 519 |
|
520 | 520 | tgname = NameStr(trigrec->tgname);
|
521 |
| - appendStringInfo(&buf, "CREATE %sTRIGGER %s", |
| 521 | + appendStringInfo(&buf, "CREATE %sTRIGGER %s ", |
522 | 522 | OidIsValid(trigrec->tgconstraint) ? "CONSTRAINT " : "",
|
523 | 523 | quote_identifier(tgname));
|
524 |
| - appendStringInfoString(&buf, pretty ? "\n " : " "); |
525 | 524 |
|
526 | 525 | if (TRIGGER_FOR_BEFORE(trigrec->tgtype))
|
527 | 526 | appendStringInfo(&buf, "BEFORE");
|
@@ -573,33 +572,27 @@ pg_get_triggerdef_worker(Oid trigid, bool pretty)
|
573 | 572 | appendStringInfo(&buf, " TRUNCATE");
|
574 | 573 | findx++;
|
575 | 574 | }
|
576 |
| - appendStringInfo(&buf, " ON %s", |
| 575 | + appendStringInfo(&buf, " ON %s ", |
577 | 576 | generate_relation_name(trigrec->tgrelid, NIL));
|
578 |
| - appendStringInfoString(&buf, pretty ? "\n " : " "); |
579 | 577 |
|
580 | 578 | if (OidIsValid(trigrec->tgconstraint))
|
581 | 579 | {
|
582 | 580 | if (OidIsValid(trigrec->tgconstrrelid))
|
583 |
| - { |
584 |
| - appendStringInfo(&buf, "FROM %s", |
| 581 | + appendStringInfo(&buf, "FROM %s ", |
585 | 582 | generate_relation_name(trigrec->tgconstrrelid, NIL));
|
586 |
| - appendStringInfoString(&buf, pretty ? "\n " : " "); |
587 |
| - } |
588 | 583 | if (!trigrec->tgdeferrable)
|
589 | 584 | appendStringInfo(&buf, "NOT ");
|
590 | 585 | appendStringInfo(&buf, "DEFERRABLE INITIALLY ");
|
591 | 586 | if (trigrec->tginitdeferred)
|
592 |
| - appendStringInfo(&buf, "DEFERRED"); |
| 587 | + appendStringInfo(&buf, "DEFERRED "); |
593 | 588 | else
|
594 |
| - appendStringInfo(&buf, "IMMEDIATE"); |
595 |
| - appendStringInfoString(&buf, pretty ? "\n " : " "); |
| 589 | + appendStringInfo(&buf, "IMMEDIATE "); |
596 | 590 | }
|
597 | 591 |
|
598 | 592 | if (TRIGGER_FOR_ROW(trigrec->tgtype))
|
599 |
| - appendStringInfo(&buf, "FOR EACH ROW"); |
| 593 | + appendStringInfo(&buf, "FOR EACH ROW "); |
600 | 594 | else
|
601 |
| - appendStringInfo(&buf, "FOR EACH STATEMENT"); |
602 |
| - appendStringInfoString(&buf, pretty ? "\n " : " "); |
| 595 | + appendStringInfo(&buf, "FOR EACH STATEMENT "); |
603 | 596 |
|
604 | 597 | /* If the trigger has a WHEN qualification, add that */
|
605 | 598 | value = fastgetattr(ht_trig, Anum_pg_trigger_tgqual,
|
@@ -643,12 +636,12 @@ pg_get_triggerdef_worker(Oid trigid, bool pretty)
|
643 | 636 | context.windowClause = NIL;
|
644 | 637 | context.windowTList = NIL;
|
645 | 638 | context.varprefix = true;
|
646 |
| - context.prettyFlags = pretty ? PRETTYFLAG_PAREN | PRETTYFLAG_INDENT : 0; |
| 639 | + context.prettyFlags = pretty ? PRETTYFLAG_PAREN : 0; |
647 | 640 | context.indentLevel = PRETTYINDENT_STD;
|
648 | 641 |
|
649 | 642 | get_rule_expr(qual, &context, false);
|
650 | 643 |
|
651 |
| - appendStringInfo(&buf, ")%s", pretty ? "\n " : " "); |
| 644 | + appendStringInfo(&buf, ") "); |
652 | 645 | }
|
653 | 646 |
|
654 | 647 | appendStringInfo(&buf, "EXECUTE PROCEDURE %s(",
|
|
0 commit comments