microsoft / azuredatastudio-postgresql

azuredatastudio-postgresql is an extension for Azure Data Studio that enables you to work with PostgreSQL databases
Other
192 stars 37 forks source link

Failed to expand node: column rel.relispartition does not exist LINE 15: AND NOT rel.relispartition #444

Open shenzj1994 opened 1 year ago

shenzj1994 commented 1 year ago

Describe the bug When open a 'tables' node in a PostgreSQL database schema. This error occurs.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Connections' on the left navigation panel
  2. Click on 'any database schema'
  3. Scroll down to 'tables' and try expand the node
  4. See error

Expected behavior It should open the node and show all tables.

Screenshots image

Desktop (please complete the following information):

ADS (please complete the following information):

Additional context This issue was fixed in https://github.com/microsoft/sqltoolsservice . Not sure if this extension has any dependency on it.

shenzj1994 commented 1 year ago

It seems only affect certain PostgreSQL variants or versions. I tested on a local docker container with PostgreSQL 15.3 but could not reproduce this issue.

DWAK-ATTK commented 11 months ago

Same issue with PostgreSQL version 9.3.13 on Ubuntu server. Using extension version 0.5.0.

vishwajatania87 commented 10 months ago

Same issue with PostgreSQL version 9.5. Using Data Studio on M2 Macbook Pro

MzeeOjuang commented 9 months ago

Experiencing the same issue, anyone know if this has been resolved?

shenzj1994 commented 9 months ago

Hi @nasc17 , I think this issue is affecting many people and it basically has no workaround. I guess it is more than an 'enhancement' but a real bug... Maybe we can re-prioritize this?

drw25 commented 9 months ago

I think the problem is with pgtoolsservice, possibly here: https://github.com/microsoft/pgtoolsservice/blob/8aac258e699436a7232129435a5197361d7cc0ba/pgsmo/objects/table/templates/9.1_plus/nodes.sql#L20

According to the Postgres documentation, the relispartition field appeared between versions 9.6 and 10 so this query is likely to fail on versions prior to 10 (the file path implies it'd be used for 9.1+). Compare https://www.postgresql.org/docs/9.6/catalog-pg-class.html and https://www.postgresql.org/docs/10/catalog-pg-class.html

PacoTuesday commented 6 months ago

Same issue with Postgresql 9.6.24. Using extension v0.6.0 on Windows 10.

shenzj1994 commented 5 months ago

I did some further testing. All the extension versions up to v0.3.1 works fine. Starting with v0.4, this error starts to appear. In my honest opinion, this is a breaking change between these 2 versions. If this is case, why is this not a bug but an 'enhancement'? I am really confused by these labels now...

peoute commented 4 months ago

We have a posgresql 8.4 install and experienced the same error. v0.3.1 seemed to work ok, but haven't completely tested it. Following this thread for updates.