Skip to content

Commit

Permalink
fix: Update instrumentation pg to support merge statements (#1317)
Browse files Browse the repository at this point in the history
* fix: support merge statement in pg versions 15+

* chore: fix json formatting for pg fixtures

* chore: use aliases in pg fixtures table for merge statement
  • Loading branch information
ericmustin authored Jan 6, 2025
1 parent b1ea804 commit 4f926f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ module Constants
LISTEN
LOAD
LOCK
MERGE
MOVE
NOTIFY
PREPARE
PREPARE
REASSIGN
REFRESH
REINDEX
Expand All @@ -54,7 +54,6 @@ module Constants
SAVEPOINT
SECURITY
SELECT
SELECT
SET
SHOW
START
Expand Down
4 changes: 4 additions & 0 deletions instrumentation/pg/test/fixtures/sql_table_name.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,9 @@
{
"name": "table_name_with_double_quotes",
"sql": "SELECT columns FROM \"test_table\""
},
{
"name": "merge",
"sql": "MERGE INTO test_table AS t USING other_table AS o ON (o.id = t.id) WHEN MATCHED THEN UPDATE SET x = t.x + 1 WHEN NOT MATCHED THEN INSERT (id, x, status) VALUES (o.id, o.x, o.status)"
}
]

0 comments on commit 4f926f1

Please sign in to comment.