Skip to content

Commit a7cb8cf

Browse files
committed
fix: support merge statement in pg versions 15+
1 parent b1ea804 commit a7cb8cf

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

instrumentation/pg/lib/opentelemetry/instrumentation/pg/constants.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ module Constants
4040
LISTEN
4141
LOAD
4242
LOCK
43+
MERGE
4344
MOVE
4445
NOTIFY
4546
PREPARE
46-
PREPARE
4747
REASSIGN
4848
REFRESH
4949
REINDEX
@@ -54,7 +54,6 @@ module Constants
5454
SAVEPOINT
5555
SECURITY
5656
SELECT
57-
SELECT
5857
SET
5958
SHOW
6059
START

instrumentation/pg/test/fixtures/sql_table_name.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,9 @@
5454
{
5555
"name": "table_name_with_double_quotes",
5656
"sql": "SELECT columns FROM \"test_table\""
57+
},
58+
{
59+
"name": "merge",
60+
"sql": "MERGE into test_table using other_table on other_table.id = test_table.id WHEN matched then update set x = test_table.x + 1 when not matched then insert (id,x,status) values (other_table.id,other_table.x,other_table.status); "
5761
}
5862
]

0 commit comments

Comments
 (0)