diff --git a/lib/postgrex/extensions/int8.ex b/lib/postgrex/extensions/int8.ex index 04a554b4..89e5128a 100644 --- a/lib/postgrex/extensions/int8.ex +++ b/lib/postgrex/extensions/int8.ex @@ -1,7 +1,7 @@ defmodule Postgrex.Extensions.Int8 do @moduledoc false import Postgrex.BinaryUtils, warn: false - use Postgrex.BinaryExtension, send: "int8send" + use Postgrex.BinaryExtension, send: "int8send", send: "pg_lsn_send" @int8_range -9_223_372_036_854_775_808..9_223_372_036_854_775_807 diff --git a/test/query_test.exs b/test/query_test.exs index eb811db5..1eb4b2c0 100644 --- a/test/query_test.exs +++ b/test/query_test.exs @@ -58,6 +58,12 @@ defmodule QueryTest do assert [[Decimal.new("NaN")]] == query("SELECT 'NaN'::numeric", []) end + @tag min_pg_version: "10.0" + test "decode lsn", context do + assert [[int, text]] = query("SELECT pg_current_wal_lsn(), pg_current_wal_lsn()::text", []) + assert Postgrex.ReplicationConnection.decode_lsn(text) == {:ok, int} + end + @tag min_pg_version: "14.0" test "decode numeric infinity", context do assert [[Decimal.new("Inf")]] == query("SELECT NUMERIC 'Infinity'", [])