Re: [pgAdmin4][Patch]: RM 5053 - Getting an error while changing the columns in the existing view

From: Akshay Joshi <akshay(dot)joshi(at)enterprisedb(dot)com>
To: Khushboo Vashi <khushboo(dot)vashi(at)enterprisedb(dot)com>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: [pgAdmin4][Patch]: RM 5053 - Getting an error while changing the columns in the existing view
Date: 2020-03-24 09:17:38
Message-ID: CANxoLDeUwJbVQa7rKUWc8TadzzRN+bULNj2qnaJFPV2JbBUc8Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi Khushboo

On Tue, Mar 24, 2020 at 1:47 PM Khushboo Vashi <
khushboo(dot)vashi(at)enterprisedb(dot)com> wrote:

> Hi Akshay,
>
> On Tue, Jan 14, 2020 at 11:47 AM Akshay Joshi <
> akshay(dot)joshi(at)enterprisedb(dot)com> wrote:
>
>> Hi Khushboo
>>
>> Following are the review comments:
>>
>> - Fix the PEP8 issue.
>> - Drop query should be part of the jinja template for consistency.
>> Currently, it is added through the python file.
>>
>> The Delete query is already in the template file, I have just reused the
> delete call and merged the SQL queries in the python file.
>
>>
>> - Any changes in the view code should not warn the user "Changing the
>> columns in a view requires dropping...." and we should not drop the view.
>> For example, I have only change the WHERE clause or added 'ORDER BY'.
>>
>> I have tested but couldn't reproduce this issue. Can you please let me
> know the proper use case?
>

Create a view with 'SELECT 1;' as code. Then change the code to 'SELECT
1234;' and click on the Save button.
Warning popup is displayed "Changing the columns in a view....". Click
on the 'Yes' button and check the OID of the view. You will get the same
OID, it means view is not recreated.

I have observed below error in the browser while changing the code:
view.js:241 Uncaught TypeError: Cannot read property 'replace'
of undefined
at child.onChange (view.js:241)
at HTMLDivElement.dispatch (jquery.js:5237)
at HTMLDivElement.elemData.handle (jquery.js:5044)

> Thanks,
> Khushboo
>
>>
>>
>
>> On Tue, Jan 14, 2020 at 10:27 AM Khushboo Vashi <
>> khushboo(dot)vashi(at)enterprisedb(dot)com> wrote:
>>
>>> Hi,
>>>
>>> Please find the attached patch for RM #5053 - Getting an error while
>>> changing the columns in the existing view.
>>>
>>> PostgreSQL doesn't allow to change the view columns. So, while
>>> performing this task the existing view should be dropped first and then
>>> recreate it and also user will get a warning first.
>>>
>>> Thanks,
>>> Khushboo
>>>
>>
>>
>> --
>> *Thanks & Regards*
>> *Akshay Joshi*
>>
>> *Sr. Software Architect*
>> *EnterpriseDB Software India Private Limited*
>> *Mobile: +91 976-788-8246*
>>
>

--
*Thanks & Regards*
*Akshay Joshi*

*Sr. Software Architect*
*EnterpriseDB Software India Private Limited*
*Mobile: +91 976-788-8246*

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Khushboo Vashi 2020-03-24 09:50:04 Re: [pgAdmin4][Patch] - RM 2186 - Support external authentication sources [LDAP]
Previous Message Khushboo Vashi 2020-03-24 08:17:37 Re: [pgAdmin4][Patch]: RM 5053 - Getting an error while changing the columns in the existing view