Function uuid_generate_v4() does not exist (SQLSTATE 42883)

Getting Error:
Function uuid_generate_v4() does not exist (SQLSTATE 42883)
Function uuid_generate_v4() does not exist (SQLSTATE 42883)
Is this just that we need add extensions before our use of uuid_generate_v4()?
extensions.uuid_generate_v4()
extensions.uuid_generate_v4()
Or would you actually create the extension?
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
SET search_path TO public, extensions;
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
SET search_path TO public, extensions;
I am a bit confused because, my migrations always worked, now they are having an issue? I am also confused because I can see in my Dashboard that uuid-ossp is installed by default? If I am running a db reset, is it just "not aware" of that? Thanks for any help!
1 Reply
vick
vick2w ago
None of my migrations enable uuid-ossp, yet I always have the generate_uuid_vX functions available. As far as I can tell, it is included as a default extension in Supabase. I do a supabase db reset every so often, the most recent of which was about a week ago. Are you saying for you it worked when you used the full schema name? If so, then you did something to remove "extensions" from your search path. The default for me is:
postgres=> show search_path;
┌──────────────────────────────┐
│ search_path │
├──────────────────────────────┤
│ "\$user", public, extensions │
└──────────────────────────────┘
(1 row)
postgres=> show search_path;
┌──────────────────────────────┐
│ search_path │
├──────────────────────────────┤
│ "\$user", public, extensions │
└──────────────────────────────┘
(1 row)

Did you find this page helpful?