skip to Main Content

I just installed Azure Data Studio (ADS) and PostgreSQL extension. ADS connects to my Postgresql and I can do queries on my database. However, the dropdown ‘Databases’ tab does not expand. When I right click, to do Refresh, an error message shows up "Error: Failed to expand node". Would someone please help? Thank you so much in advance.

3

Answers


  1. Seems to be a known issue with ADS since pg_database.datlastsysoid field was removed in PostgreSQL 15. I am also waiting for a solution.

    Azure Data Studio issue:
    https://github.com/microsoft/azuredatastudio-postgresql/issues/333

    Rationale for removing datlastsysoid in version 15:
    https://www.postgresql.org/message-id/CA%2BTgmoa14%3DBRq0WEd0eevjEMn9EkghDB1FZEkBw7%2BUAb7tF49A%40mail.gmail.com

    Login or Signup to reply.
  2. Followed Crocodilus’s instruction to edit the nodes query replacing line
    db.datlastsysoid with 0 as datlastsysoid
    worked for me. One update is adding a slash after the userprofile reference:
    %USERPROFILE%.azuredatastudioextensionsmicrosoft.azuredatastudio-postgresql-0.2.7outossdbtoolsserviceWindowsv1.5.0pgsqltoolsservicelibpgsmoobjectsdatabasetemplates+defaultnodes.sql

    Login or Signup to reply.
  3. For folks on MacOS, here’s the requisite file:

    ~/.azuredatastudio/extensions/microsoft.azuredatastudio-postgresql-0.2.7/out/ossdbtoolsservice/OSX/v1.5.0/pgsqltoolsservice/lib/pgsmo/objects/database/templates/+default/nodes.sql

    And for completions sake, the updated contents:

    {#
     # pgAdmin 4 - PostgreSQL Tools
     #
     # Copyright (C) 2013 - 2017, The pgAdmin Development Team
     # This software is released under the PostgreSQL Licence
     #}
    SELECT
        db.oid as oid,
        db.datname as name,
        ta.spcname as spcname,
        db.datallowconn,
        0 As datlastsysoid,
        has_database_privilege(db.oid, 'CREATE') as cancreate,
        datdba as owner,
        db.datistemplate ,
        has_database_privilege(db.datname, 'connect') as canconnect,
        datistemplate as is_system
    
    FROM
        pg_database db
        LEFT OUTER JOIN pg_tablespace ta ON db.dattablespace = ta.oid
    {% if did %}
    WHERE db.oid = {{ did|qtLiteral }}::OID
    {% elif last_system_oid %}
    WHERE db.oid > {{ last_system_oid }}::OID
    {% endif %}
    
    ORDER BY datname;
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search