Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jGfh5-0001Be-7H for pgadmin-hackers@arkaria.postgresql.org; Tue, 24 Mar 2020 09:17:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jGfh4-0006ML-2I for pgadmin-hackers@arkaria.postgresql.org; Tue, 24 Mar 2020 09:17:54 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jGfh3-0006ME-In for pgadmin-hackers@lists.postgresql.org; Tue, 24 Mar 2020 09:17:53 +0000 Received: from mail-il1-x134.google.com ([2607:f8b0:4864:20::134]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jGfh0-0002BL-Hl for pgadmin-hackers@postgresql.org; Tue, 24 Mar 2020 09:17:52 +0000 Received: by mail-il1-x134.google.com with SMTP id h3so16080683ils.3 for ; Tue, 24 Mar 2020 02:17:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=U5WPPrfsi8KpRZWMTWyfrZ/FUCQ4TKtXNRgJeyIbTks=; b=CR1QGsjck2pDUut8pIt0WVcmjhvNw1UmiGct4LXM+dGZ5qknCz6aVjGTw3qqOFH737 ABe5vg36LxR2rLuInaKp0CzetuGbTwQ0mUUqimJbfKXQY2MD1EFkYsA7yZmfHSPP9LTc l4bzoGH7CnCs1kKbgUNs0TG6fnVVPTQhjBz9N7EhcVFT9sCOtUyZ2eD0+rCTnMATRYgt bxg1qmG25n/LY08fh2k+Ee7yaqncNBWCz7VE4FY6rHjNFYweSyjdBKo9rDmyAYk8BUnp 5oRZb7o3G7k59P5YMj9I0joFKbYnBWLdG9mke69vV+fUW9Jt3VyyoZRjsks5YVC8KmVa ya1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=U5WPPrfsi8KpRZWMTWyfrZ/FUCQ4TKtXNRgJeyIbTks=; b=oVFK0aNJiXlJnQUglzfiqDrQKppofwoXMxySye3bMCPxChkrVYU4gPJBh660AJ/NPd hxSiusosBjJQIBE+wcIwCk2YjGnxZBkYawZwXoKGEaGcOt+nHx9cWE99g+FZvzkSN9py xruEVCmCEMA0qa1YpGjjqWnm1QeoOgGOvfKnv09OjfQJAs0jGY+S6VxgT8S/uHMY33hB EXy230tPcQ/2MXkCoKQL365ii1T6x6d6XT/rP67aQ/a77AioE6ItYLcg87IBWK+0VlUi Fw0cvE56T6LeCw8404LQxRmhIo9sMZZ5MQJd2POzGyRLQ/ydVGdlWRUyWqo4UW3E7r0v oi3g== X-Gm-Message-State: ANhLgQ0IfbC6Sjl7pqPNXgyXkJgDfXDVavsNliX49+klzUCYNHei8YrP DPc8lq/RBgqEVOW9+sSv1NVtfrXvccJ+yROy+KtZCS91YthMlw2lbeyk8zHsIb5g3EwY8ukFky2 Mxa4eycnEXeE9reF+neVp7Hb6F5eprcO6be1Ga+bpoex2YF5xojtlP8Fxoa31PivxwPPYKYknIy VdY9tYTaAdzsNA6eV11xmoimgbqG3ZUUvrMaPr8++LoxjoQ3ol7MY= X-Google-Smtp-Source: ADFU+vuYU7nn4a5+MS97xlH633fjpTn/2PoMIoKKInOLieIq7YAFh64EzuNeEeeV/DTHZBG4jBS2RVd5crB+kXxK9Ng= X-Received: by 2002:a92:8c45:: with SMTP id o66mr25771200ild.236.1585041469594; Tue, 24 Mar 2020 02:17:49 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Akshay Joshi Date: Tue, 24 Mar 2020 14:47:38 +0530 Message-ID: Subject: Re: [pgAdmin4][Patch]: RM 5053 - Getting an error while changing the columns in the existing view To: Khushboo Vashi Cc: pgadmin-hackers Content-Type: multipart/alternative; boundary="000000000000bff50805a19639de" X-CLOUD-SEC-AV-Info: edb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --000000000000bff50805a19639de Content-Type: text/plain; charset="UTF-8" Hi Khushboo On Tue, Mar 24, 2020 at 1:47 PM Khushboo Vashi < khushboo.vashi@enterprisedb.com> wrote: > Hi Akshay, > > On Tue, Jan 14, 2020 at 11:47 AM Akshay Joshi < > akshay.joshi@enterprisedb.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.vashi@enterprisedb.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* --000000000000bff50805a19639de Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi=C2=A0Khushboo


=C2=A0 =C2=A0 I have observed below error in the browser while changing th= e code:=C2=A0
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 view.js:2= 41 Uncaught TypeError: Cannot read property 'replace' of undefined<= br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at child.onChange (view.= js:241)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at HTMLDivElement.disp= atch (jquery.js:5237)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 at HTMLD= ivElement.elemData.handle (jquery.js:5044)
=

Thanks,
Khushboo
=
=C2= =A0

Hi,

Please find the attached patch for RM #5053 -=C2=A0Getting an error while= changing the columns in the existing view.

Postgr= eSQL doesn't allow to change the view columns. So, while performing thi= s task the existing view should be dropped first and then recreate it and a= lso user will get a warning first.

Thanks,
Khushboo


--
Thanks & Regards
Akshay Joshi
<= font color=3D"#3333FF">Sr. Software Architect=
<= font color=3D"#000000" face=3D"arial, sans-serif">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
--000000000000bff50805a19639de--