Skip to content

Commit

Permalink
Refer to function with schema-qualified name
Browse files Browse the repository at this point in the history
This commit restores relocability of the extension which was broken by
not referring to a function called in verify() with @extschema@ prefix.
For more information, see
https://www.postgresql.org/docs/current/extend-extensions.html, section
extension relocatability.
  • Loading branch information
burrscurr committed Nov 13, 2021
1 parent e7b1128 commit 8aba549
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pgjwt--0.1.1--0.2.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ RETURNS table(header json, payload json, valid boolean) LANGUAGE sql AS $$
jwt.header AS header,
jwt.payload AS payload,
jwt.signature_ok AND tstzrange(
to_timestamp(try_cast_double(jwt.payload->>'nbf')),
to_timestamp(try_cast_double(jwt.payload->>'exp'))
to_timestamp(@extschema@.try_cast_double(jwt.payload->>'nbf')),
to_timestamp(@extschema@.try_cast_double(jwt.payload->>'exp'))
) @> CURRENT_TIMESTAMP AS valid
FROM (
SELECT
Expand Down

0 comments on commit 8aba549

Please # to comment.