microsoft / azuredatastudio-postgresql

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

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 6 months ago

Tkcatch commented 6 months ago

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):

ADS (please complete the following information):

Tkcatch commented 5 months ago

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

samir-puranik commented 5 months ago

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 commented 5 months ago

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 commented 2 months ago

Any timeline update on this?