supabase / dbdev

Database Package Registry for Postgres
https://database.dev/
Apache License 2.0
370 stars 19 forks source link

no dbdev extension after running install script #177

Closed logemann closed 5 months ago

logemann commented 5 months ago

Bug report

Describe the bug

after running the install script as outlined here: https://database.dev/supabase/dbdev on supabase cloud, i cant find the extension in the extensions overview. Script ran w/o problems though.

Of course i also cant do: select * from dbdev('kiwicopple-pg_idkit')

ERROR:  42883: function dbdev(unknown) does not exist
LINE 1: select * from dbdev('kiwicopple-pg_idkit');
                      ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts. 

I am also puzzled of the install script using pg_tle while tle is not being available in supabase cloud.

Expected behavior

a running package manager client.

imor commented 5 months ago

Extensions installed using dbdev are not visible on the extensions page because they are trusted language extensions. You can view them with the following sql:

select * from pgtle.available_extensions();

The complete pg_tle api is documented here: https://github.com/aws/pg_tle/blob/main/docs/03_managing_extensions.md.

pg_tle is also not visible on the dashboard but is available. As per the installation instructions it needs to be set in shared_preload_libraries, so you can see it is set by running:

show shared_preload_libraries;
logemann commented 5 months ago

But can you comment on the real error then? Its nice to know that i cant see the extensions but this doesnt explain my error

Furthermore select * from pgtle.available_extensions();gives me:

ERROR:  42883: function pgtle.available_extensions() does not exist
LINE 1: select * from pgtle.available_extensions();
                      ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

And to be clear... i am still speaking about supabase cloud. So this doesnt make sense to me:

_"Once you have installed the pg_tle extension files into your PostgreSQL installation, you can start using pg_tle to install Trusted Language Extensions. Before running CREATE EXTENSION, you will have to add pg_tle to the shared_preloadlibraries configuration parameter and restart PostgreSQL. There are a few methods to do this. Note that you must use Method #3 for Amazon RDS for PostgreSQL and Amazon Aurora PostgreSQL-compatible edition."

imor commented 5 months ago

Did you install the dbdev in-database client by following the instructions here: https://database.dev/supabase/dbdev

The line create extension if not exists pg_tle; in the script at the bottom of the above page creates the pg_tle extension. Without this there will be no pgtle schema which is why you are probably seeing the error ERROR: 42883: function pgtle.available_extensions() does not exist. Also you shouldn't need to follow pg_tle's instructions to install it because it is already installed in supabase cloud, you just need to create the extension, which the above script does.

Regarding the older error you mentioned (ERROR: 42883: function dbdev(unknown) does not exist), it is because dbdev is not a function.

If you still see errors after following the instructions above, please raise a support ticket at supabase.help and someone should be able to help you.

logemann commented 5 months ago

You said "pg_tle" is already installed on supabase... when running the install script, i get:

ERROR:  0A000: extension "pg_tle" is not available
DETAIL:  Could not open extension control file "/var/lib/postgresql/extension/pg_tle.control": No such file or directory.
HINT:  The extension must first be installed on the system where PostgreSQL is running.

So it seems pg_tle is not pre-installed on supabse cloud.

imor commented 5 months ago

It is available in the cloud, but something might be wrong with your project. Please raise a support ticket to get someone to take a look.