|
9 | 9 | * |
10 | 10 | * |
11 | 11 | * IDENTIFICATION |
12 | | - * $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.272 2008/03/28 00:21:56 tgl Exp $ |
| 12 | + * $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.273 2008/05/03 23:19:20 tgl Exp $ |
13 | 13 | * |
14 | 14 | *------------------------------------------------------------------------- |
15 | 15 | */ |
@@ -2443,9 +2443,13 @@ get_update_query_def(Query *query, deparse_context *context) |
2443 | 2443 | appendStringInfoChar(buf,' '); |
2444 | 2444 | context->indentLevel+=PRETTYINDENT_STD; |
2445 | 2445 | } |
2446 | | -appendStringInfo(buf,"UPDATE %s%s SET", |
| 2446 | +appendStringInfo(buf,"UPDATE %s%s", |
2447 | 2447 | only_marker(rte), |
2448 | 2448 | generate_relation_name(rte->relid)); |
| 2449 | +if (rte->alias!=NULL) |
| 2450 | +appendStringInfo(buf," %s", |
| 2451 | +quote_identifier(rte->alias->aliasname)); |
| 2452 | +appendStringInfoString(buf," SET "); |
2449 | 2453 |
|
2450 | 2454 | /* Add the comma separated list of 'attname = value' */ |
2451 | 2455 | sep=""; |
@@ -2517,12 +2521,15 @@ get_delete_query_def(Query *query, deparse_context *context) |
2517 | 2521 | Assert(rte->rtekind==RTE_RELATION); |
2518 | 2522 | if (PRETTY_INDENT(context)) |
2519 | 2523 | { |
2520 | | -context->indentLevel+=PRETTYINDENT_STD; |
2521 | 2524 | appendStringInfoChar(buf,' '); |
| 2525 | +context->indentLevel+=PRETTYINDENT_STD; |
2522 | 2526 | } |
2523 | 2527 | appendStringInfo(buf,"DELETE FROM %s%s", |
2524 | 2528 | only_marker(rte), |
2525 | 2529 | generate_relation_name(rte->relid)); |
| 2530 | +if (rte->alias!=NULL) |
| 2531 | +appendStringInfo(buf," %s", |
| 2532 | +quote_identifier(rte->alias->aliasname)); |
2526 | 2533 |
|
2527 | 2534 | /* Add the USING clause if given */ |
2528 | 2535 | get_from_clause(query," USING ",context); |
|