ng-galien / idea-plpgdebugger

A plugin to debug PL/pg in Intellij
MIT License
49 stars 8 forks source link

Missing extensions although they are installed #251

Open petr-jencek opened 3 months ago

petr-jencek commented 3 months ago

Describe the bug Error message "Diagnostic error" containing "Extension must be created in the current database" together with list of installed extensions is reported toghether with list of extensions, which are actually created.

To Reproduce Sorry for not providing an exact way of reproduction - it includes connecting to our production database, which is obviously not possible. Steps to reproduce the behavior:

  1. Check, which extensions are installed using "SELECT * FROM pg_extension;" - returns: plpgsql, pljava, plperl, plperlu, hstore, pgcrypto, unaccent, system_stats
  2. Click on Debug.
  3. Error message mentioned above appears.

Expected behavior Query debugging starts.

Desktop (please complete the following information):

ng-galien commented 3 months ago

Hi @petr-jencek

It’s possible that the issue might be related to the search path in your database. If you can access the extension but the plugin cannot, the search path may not be set correctly or could be invalid. You can configure the search path in the plugin settings within IntelliJ, where there's an input for an SQL statement that runs before each query. This could help ensure the correct path is used.

petr-jencek commented 3 months ago

HI @ng-galien I've set custom command to: set search_path = "public", "ext", ...; (all namespaces in the database) image Unfortunatelly it didn't solve the problem: image

ng-galien commented 3 months ago

Is the debugger extension installed in the public schema?

SELECT
    t_namespace.nspname,
    t_extension.extname,
    t_extension.extversion
FROM pg_extension t_extension
         JOIN pg_namespace t_namespace ON t_extension.extnamespace = t_namespace.oid

try to install it in public for testing. You can also set debugger option to check logs