Closed cashweaver-zz closed 7 years ago
@cashweaver What's the result of this query?
SELECT default_version, installed_version
FROM pg_available_extensions
WHERE name = 'pg_hashids';
Additional errors (for future searchability):
SELECT * FROM id_encode(CAST (14 as BIGINT), 'mysalt', 4, 'abcdefghkmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ123456789-_');
ERROR: function id_encode(bigint, unknown, integer, unknown) does not exist
LINE 1: SELECT * FROM id_encode(CAST (14 as BIGINT), 'mysalt...
SELECT * FROM id_encode(CAST (14 as BIGINT), CAST ('mysalt' as text), 4, CAST ('abcdefghkmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ123456789-_' as text));
ERROR: function id_encode(bigint, text, integer, text) does not exist
LINE 1: SELECT * FROM id_encode(CAST (14 as BIGINT), CAST ('mysalt...
Thanks for the sanity-check!
SELECT default_version, installed_version
FROM pg_available_extensions
WHERE name = 'pg_hashids';
default_version | installed_version
-----------------+-------------------
1.2 |
(1 row)
Turns out I had my terminals mixed up and was running the installation commands on my local dev environment. I had never run ALTER EXTENSION pg_hashids UPDATE;
on my prod server.
ALTER EXTENSION pg_hashids UPDATE;
ALTER EXTENSION
SELECT default_version, installed_version
FROM pg_available_extensions
WHERE name = 'pg_hashids';
default_version | installed_version
-----------------+-------------------
1.2 | 1.2
(1 row)
SELECT * FROM id_encode(CAST (14 as BIGINT), 'mysalt', 4, 'abcdefghkmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ123456789-_');
id_encode
-----------
8WQ6
(1 row)
Working perfectly now!
Just pushed an app up to production and started getting this error:
error: function id_encode(bigint, unknown, integer, unknown) does not exist
I'm invoking id_encode like:
Haven't seen it in local development at all. I'm trying to track down the mistake I've made and will update this issue for future reference.