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

View level 'script as create' returns definition of the first view in the folder of the object selector on Azure PostgreSQL 15.4 flexible server #494

Open
Tkcatch opened this issue Jan 5, 2024 · 5 comments · May be fixed by microsoft/pgtoolsservice#489
Assignees
Labels
GA GA item

Comments

@Tkcatch
Copy link

Tkcatch commented Jan 5, 2024

Recently upgraded from single server PostgreSQL 11 to flexible server PostgreSQL 15.4.

When using the explorer and navigating to the Views folder within a schema, right clicking on a view, and selecting Script as Create, an editor will open and list the correct name of the view with comments and a drop statement, but the contents of the view will always be of whatever the first view within the folder is.

E.g. the first view. alphabetically will present as correct:

-- View: public.a_view

-- DROP VIEW public.a_view;

CREATE OR REPLACE VIEW public.a_view AS
 SELECT a.name,
    a.description
  FROM authr.a_table a

But the second will be a copy

-- View: public.b_view

-- DROP VIEW public.b_view;

CREATE OR REPLACE VIEW public.b_view AS
 SELECT a.name,
    a.description
  FROM authr.a_table a

When it's actually defined as:

-- View: public.b_view

-- DROP VIEW public.b_view;

CREATE OR REPLACE VIEW public.b_view AS
 SELECT b.definition,
    b.environment
  FROM authr.b_table b

Expected behavior would be that the appropriate view script would be generated in the editor.

Desktop (please complete the following information):

  • OS: Windows 11

ADS (please complete the following information):

  • ADS Version 1.47.0
  • ADS PostgresSQL extension version 0.6.0
  • PostgreSQL version 15.4
@Tkcatch
Copy link
Author

Tkcatch commented Feb 7, 2024

@samir-puranik any idea when this update may be available?

@samir-puranik
Copy link
Collaborator

samir-puranik commented Feb 7, 2024

Hi @Tkcatch the change for this fix is already completed but we are still working on timelines for the next release. Will update as soon as possible!

@Tkcatch
Copy link
Author

Tkcatch commented Feb 8, 2024

Thank you, @samir-puranik! I wasn't sure if you were still waiting on the additional approval to you pull request. I can definitely tell you, my colleagues and I will be incredibly excited when this is fixed! Thank you for the support!

@Tkcatch
Copy link
Author

Tkcatch commented Apr 18, 2024

Any timeline update on this?

@Tkcatch
Copy link
Author

Tkcatch commented Jul 16, 2024

Any updates on this? I've seen some local fixes tossed around but trying to follow them I find that I don't have a lib folder in my pgsqltoolsservice folder so I don't really know where to go from there. Help is very welcome!

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

https://stackoverflow.com/questions/74376366/azure-data-studio-failed-to-expand-node

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

Successfully merging a pull request may close this issue.

3 participants