Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when disconnecting from Postgres 15.0 connection #334

Closed
bwong365 opened this issue Oct 19, 2022 · 11 comments
Closed

Error when disconnecting from Postgres 15.0 connection #334

bwong365 opened this issue Oct 19, 2022 · 11 comments

Comments

@bwong365
Copy link

bwong365 commented Oct 19, 2022

From Azure Data Studio:

Failed to close OE session: column db.datlastsysoid does not exist.

On the Postgres side:

2022-10-19 19:03:14.467 UTC [189] ERROR:  column db.datlastsysoid does not exist at character 106
2022-10-19 19:03:14.467 UTC [189] STATEMENT:  
SELECT
    db.oid as oid, 
    db.datname as name, 
    ta.spcname as spcname, 
    db.datallowconn,
    db.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
 ORDER BY datname;
@jonashilmersson
Copy link

+1

1 similar comment
@dtwilliams10
Copy link

+1

@Aidan-Chang
Copy link

I fixed it locally.
go to %USERPROFILE%.azuredatastudio\extensions\microsoft.azuredatastudio-postgresql-0.2.7
find nodes.sql file in the sub directory out\ossdbtoolsservice\Windows\v1.5.0\pgsqltoolsservice\lib\pgsmo\objects\database\templates+default\

change db.datlastsysoid, to 0 as datlastsysoid, in the sql text.
save and reopen the azure data studio

@wehnertb
Copy link

wehnertb commented Nov 21, 2022

+1 - Thank you! - I was getting this when trying to expand databases in tree.

@jammerware
Copy link

I fixed it locally. go to %USERPROFILE%.azuredatastudio\extensions\microsoft.azuredatastudio-postgresql-0.2.7 find nodes.sql file in the sub directory out\ossdbtoolsservice\Windows\v1.5.0\pgsqltoolsservice\lib\pgsmo\objects\database\templates+default\

change db.datlastsysoid, to 0 as datlastsysoid, in the sql text. save and reopen the azure data studio

This was really helpful, thank you! For anyone for whom this doesn't fix it, note that you may have to do a little more depending on... factors I don't really understand as a Postgres newbie 🤣 See my comment here.

@aaronschendel
Copy link

0 as datlastsysoid,

This fixed my issue today - thank you!

@sanyog2491
Copy link

I fixed it locally. go to %USERPROFILE%.azuredatastudio\extensions\microsoft.azuredatastudio-postgresql-0.2.7 find nodes.sql file in the sub directory out\ossdbtoolsservice\Windows\v1.5.0\pgsqltoolsservice\lib\pgsmo\objects\database\templates+default\

change db.datlastsysoid, to 0 as datlastsysoid, in the sql text. save and reopen the azure data studio

how to open this m really not getting how to fix using this solution

@wehnertb
Copy link

@sanyog2491 - if you navigate to this directory (easiest way is to open File Explorer and past it into the address bar).

%USERPROFILE%.azuredatastudio\extensions\microsoft.azuredatastudio-postgresql-0.2.7\out\ossdbtoolsservice\Windows\v1.5.0\pgsqltoolsservice\lib\pgsmo\objects\database\templates+default

Edit the file "nodes.sql" and you should see a line referencing "datlastsysoid" - you want to change that line to look like this:

0 as datlastsysoid,

Save the file and then open Azure Data Studio again and the issue should be resolved.

@RachelAmbler
Copy link

For MacOS this can be found at

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

@lucadistefano
Copy link

@RachelAmbler @Aidan-Chang thanks it fixed the problem for me too

@DaeunYim
Copy link
Contributor

Tracking from #357. Closing the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests