From a7631dcddf6fe3098e330f701e12e37f8e96fe36 Mon Sep 17 00:00:00 2001 From: Jesse de Wit Date: Tue, 3 Jan 2023 19:54:04 +0100 Subject: [PATCH] make prepared statement understand bigint --- db.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db.go b/db.go index 4b23902..b68cbf5 100644 --- a/db.go +++ b/db.go @@ -86,8 +86,8 @@ func insertChannel(initialChanID, confirmedChanId uint64, channelPoint string, n query := `INSERT INTO channels (initial_chanid, confirmed_chanid, channel_point, nodeid, last_update) - VALUES ($1, NULLIF($2, 0), $3, $4, $5) - ON CONFLICT (channel_point) DO UPDATE SET confirmed_chanid=NULLIF($2,0), last_update=$5` + VALUES ($1, NULLIF($2, 0::int8), $3, $4, $5) + ON CONFLICT (channel_point) DO UPDATE SET confirmed_chanid=NULLIF($2, 0::int8), last_update=$5` c, err := pgxPool.Exec(context.Background(), query, int64(initialChanID), int64(confirmedChanId), channelPoint, nodeID, lastUpdate)