Skip to content

Commit 5dcebd1

Browse files
committed
Doc fixes for MERGE statement
In commit 3d895bc I introduced a bogus semicolon mid-statement by careless cut-n-paste; move it. This had already been reported by Justin Pryzby. Also, change the styling a bit by avoiding names in CamelCase. This is more consistent with the style we use elsewhere. Backpatch to 15. Author: Vitaly Burovoy <vitaly.burovoy@gmail.com> Reviewed-by: Vik Fearing <vik@postgresfriends.org> Discussion: https://postgr.es/m/9afe5766-5a61-7860-598c-136867fad065@gmail.com Discussion: https://postgr.es/m/20220819133016.GV26426@telsasoft.com
1 parent 8c848cd commit 5dcebd1

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

doc/src/sgml/ref/merge.sgml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -554,18 +554,18 @@ MERGE <replaceable class="parameter">total_count</replaceable>
554554
<title>Examples</title>
555555

556556
<para>
557-
Perform maintenance on <literal>CustomerAccounts</literal> based
558-
upon new <literal>Transactions</literal>.
557+
Perform maintenance on <literal>customer_accounts</literal> based
558+
upon new <literal>recent_transactions</literal>.
559559

560560
<programlisting>
561-
MERGE INTO CustomerAccount CA
562-
USING RecentTransactions T
563-
ON T.CustomerId = CA.CustomerId
561+
MERGE INTO customer_account ca
562+
USING recent_transactions t
563+
ON t.customer_id = ca.customer_id
564564
WHEN MATCHED THEN
565-
UPDATE SET Balance = Balance + TransactionValue
565+
UPDATE SET balance = balance + transaction_value
566566
WHEN NOT MATCHED THEN
567-
INSERT (CustomerId, Balance)
568-
VALUES (T.CustomerId, T.TransactionValue);
567+
INSERT (customer_id, balance)
568+
VALUES (t.customer_id, t.transaction_value);
569569
</programlisting>
570570
</para>
571571

@@ -575,14 +575,14 @@ WHEN NOT MATCHED THEN
575575
during execution.
576576

577577
<programlisting>
578-
MERGE INTO CustomerAccount CA
579-
USING (Select CustomerId, TransactionValue From RecentTransactions) AS T
580-
ON T.CustomerId = CA.CustomerId
578+
MERGE INTO customer_account ca
579+
USING (SELECT customer_id, transaction_value FROM recent_transactions) AS t
580+
ON t.customer_id = ca.customer_id
581581
WHEN MATCHED THEN
582-
UPDATE SET Balance = Balance + TransactionValue;
582+
UPDATE SET balance = balance + transaction_value
583583
WHEN NOT MATCHED THEN
584-
INSERT (CustomerId, Balance)
585-
VALUES (T.CustomerId, T.TransactionValue)
584+
INSERT (customer_id, balance)
585+
VALUES (t.customer_id, t.transaction_value);
586586
</programlisting>
587587
</para>
588588

0 commit comments

Comments
 (0)