Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axqf4-0004Sm-6a for pgadmin-hackers@arkaria.postgresql.org; Wed, 04 May 2016 06:51:54 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1axqf3-00015C-H3 for pgadmin-hackers@arkaria.postgresql.org; Wed, 04 May 2016 06:51:53 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1axqf2-00014l-PT for pgadmin-hackers@postgresql.org; Wed, 04 May 2016 06:51:52 +0000 Received: from mail-lf0-x235.google.com ([2a00:1450:4010:c07::235]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1axqey-00046S-4c for pgadmin-hackers@postgresql.org; Wed, 04 May 2016 06:51:52 +0000 Received: by mail-lf0-x235.google.com with SMTP id j8so48174262lfd.2 for ; Tue, 03 May 2016 23:51:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=iRICvQGQo2eGmiUiy79ETOO5xTmSYuWJxv5vs2ZOsTs=; b=a+CYiclZ9Qs/eVoNNFBNfE7N/aplxoW2rYd+SuIQavW1zhGCgUUU8AsBZDY1fZ+BS9 39JZgNvHl3JjDBIL4Zifa6CSKdYcUsOWD4OWaBh9AQIgXt+259ae2bHP/g4dP7DcIrnr cE7I6zYDx2KEJQMonEDvqBXOdXVZnqnyD6yttvlJmkDwbIAuKrCkz+sWyUz/VEXHV9Vk BUJGQBYnK+ACok/fGJd/T1wAYWpIZrkhOFChgzAPJeuRMGQ6+giGzFQdbZXOFkRsE60T vfx7WCXlq/AS3HFndscUMLC5eW+hklLaM6QxrrAFySxfqW7yMDvrKxpvY1InYAbYdj8G 0u1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=iRICvQGQo2eGmiUiy79ETOO5xTmSYuWJxv5vs2ZOsTs=; b=MKHsAEVfjiur5lO4Eb2dTot93vbd31lEQNaHV5oxAxuV0VV3tW0yolPkGDKqpHBjn5 d/cG2M+OThioPHeGaUlJ5pgDmwfMtPmazFbb3MVYXyO1RvvY16m/Oqj2oD7MJE/1ULRH fZDc4hyIaEwCJ3o4cBWyGOA4HgujOIgl3gQum+jXF1Y+7IkHDTvtPPvrGYWdhnlKrJRF EKkIsBatJv//K1uw1Kv/1qTzTN3cahszbRmNdHQ7TBTlIi63TnKgqin2fPD2f7A/BsoY ztnfV5akC6FWSr/GV5DpBMaJpdhl8+Kl+OLNorGRqXNt/1v4+rmjhMkWdiTO2gpJJXmf QQGQ== X-Gm-Message-State: AOPr4FXVUbg03C1afH2DhsSighROqJVgO217P8e8MTM5d4Pk69z2wYIqjLHTt5pcTbvu3PUUuaMWzgr642xsVmjR MIME-Version: 1.0 X-Received: by 10.25.151.20 with SMTP id z20mr3299843lfd.92.1462344707246; Tue, 03 May 2016 23:51:47 -0700 (PDT) Received: by 10.25.144.81 with HTTP; Tue, 3 May 2016 23:51:47 -0700 (PDT) In-Reply-To: References: Date: Wed, 4 May 2016 12:21:47 +0530 Message-ID: Subject: Re: [pgAdmin4] [Patch]: Foreign Table Module From: Khushboo Vashi To: Dave Page Cc: pgadmin-hackers Content-Type: multipart/alternative; boundary=001a11401516d0b4000531fea8ec X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgadmin-hackers Precedence: bulk Sender: pgadmin-hackers-owner@postgresql.org --001a11401516d0b4000531fea8ec Content-Type: text/plain; charset=UTF-8 Hi Dave, In PG 9.5, for Foreign Table Editing, below new functionalities are added: - ALTER [ COLUMN ] column_name SET STORAGE { PLAIN | EXTERNAL | EXTENDED | MAIN } - DISABLE TRIGGER [ trigger_name | ALL | USER ] - ENABLE TRIGGER [ trigger_name | ALL | USER ] - ENABLE REPLICA TRIGGER trigger_name - ENABLE ALWAYS TRIGGER trigger_name - SET WITH OIDS - SET WITHOUT OIDS As per our conversation yesterday, we need to incorporate these functionalities into pgAdmin4. Here I have some queries regarding the implementation. Under the Foreign Table Node, we don't have separate nodes for columns, triggers and constraints as table. So in order to add above Trigger related functionalities, we will have to add Trigger Node under the Foreign Table. And If we add Triggers, then Do we need to add Columns and Constraints as separate nodes under the Foreign Table? Thanks, Khushboo On Fri, Apr 29, 2016 at 12:20 PM, Neel Patel wrote: > Hi Khushboo, > > Below are the observations. > > - When we create the new Foreign Table with column name and types then > it shows NULL along with column name and type in properties tab. > > e.g. column_1 xml[] NULL > > - Once we inherits the table from another table then column and > another parameters of inherited table should not allowed to change. > - When we create any foreign table then same foreign table is also > listed under "Tables" node. > - SQL is not generated properly. Please find below SQL which gives > error during execution. > > CREATE FOREIGN TABLE public.test_2 > (id1 integer NOT NULL DEFAULT12 COLLATEpg_catalog."POSIX") > SERVER fsrv; > > - When we create the new foreign table with security label then no SQL > is generated for security label. > - In Edit mode, when we provide security label with both value > "provider" and "security label" then security label is displayed NULL > > e.g. SECURITY LABEL FOR frgn_table ON FOREIGN TABLE > public.fsrv_table IS NULL; > > - During creation of the column, when we remove the collation then it > gives below error. > > TypeError: item is undefined > > - Delete/Drop cascade functionality is not working, we are getting > below error. > > TypeError: self.canDrop.apply is not a function > > - When we edit the foreign table and try to remove the existing "Data > Type" of column then it gives below error. > > TypeError: this.dataAdapter is null > > - Create the new foreign table and click on ADD button in Column tab > and do not provide any column name and data type. Need to do proper > validation in Column tab for all parameters. Currently if user do not > provide any value then wrong SQL is getting generated. > > CREATE FOREIGN TABLE public.test_4 > (None None NULL) > SERVER test_fsrv; > > - When we do not provide the Check parameters in constraint then it > gives SQL syntax error. > > CREATE FOREIGN TABLE public.test_5 > () > SERVER test_fsrv; > > ALTER FOREIGN TABLE public.test_5 > ADD CONSTRAINT test CHECK () NOT VALID; > > - If we edit foreign table and change the schema then it gives below > error. > > IndexError: list index out of range > > - We should have proper indentation in the SQL tab once we give the > parameters. Currently it looks like below for "Options" value. > > CREATE FOREIGN TABLE "1_test"."5_test" > () > SERVER asas > OPTIONS (test1 'test2' > , test3 'test4'); > > - If user provide foreign table name and do not provide foreign server > and click on SQL tab then we are getting error on browser side as below. We > should have proper error handling in this case. > > Couldn't find the required parameter (ftsrvname). > > - Create the foreign table, add the constraint and do not provide any > constraint information then SQL generated is wrong. > > CREATE FOREIGN TABLE "1_test"."9_test" > () > SERVER test_fsrv; > > ALTER FOREIGN TABLE "1_test"."9_test" > ADD CONSTRAINT None CHECK (); > > - When we click on the foreign table collection node then "Comment" > column is blank even though we have comment in the foreign table. > - Create the foreign table on PG 9.1 and after pressing Save button we > are getting below error. > > "the JSON object must be str, not 'list'" > > - When we delete the options parameters then it gives SQL error > because DROP statement does not include the value. > > ALTER FOREIGN TABLE public.test_12 > OPTIONS ( DROP ser2 'val2'); > > - There are some new functionality added in PG 9.5. Do we really need > to implement ? Need to discuss with Dave/Ashesh. Below are the new > functionality. > > - In create foreign table,we have added column constraint > but "table constraint" is added from 9.5.Do we really require to add > table constraint ? > - In alter foreign table, below are the new functionality > added. > 1. ALTER [ COLUMN ] column_name SET STORAGE { PLAIN > | EXTERNAL | EXTENDED | MAIN } > 2. DISABLE TRIGGER [ trigger_name | ALL | USER ] > 3. ENABLE TRIGGER [ trigger_name | ALL | USER ] > 4. ENABLE REPLICA TRIGGER trigger_name > 5. ENABLE ALWAYS TRIGGER trigger_name > 6. SET WITH OIDS > 7. SET WITHOUT OIDS > > Do let us know in case of any queries. > > Thanks, > Neel Patel > > On Tue, Apr 5, 2016 at 2:27 PM, Khushboo Vashi < > khushboo.vashi@enterprisedb.com> wrote: > >> Hi, >> >> Please find updated patch for the Foreign Table Module. >> >> This patch is dependent on >> 1. Backgrid Depscell Patch, (submitted by me) >> 2. NodeAjaxOptionsCell Transform change patch, on which Ashesh and >> Murtuza are working >> >> Thanks, >> Khushboo >> >> >> >> >> On Wed, Feb 24, 2016 at 2:57 PM, Khushboo Vashi < >> khushboo.vashi@enterprisedb.com> wrote: >> >>> Hi, >>> >>> I have updated the Foreign Table module as below: >>> >>> - Used 'NodeByListControl' to get schemas, in the foreign_table.js file >>> as suggested by Ashesh to avoid code redundancy. >>> >>> - Applied *'Security Label Macro'* Patch (Implemented by Harshal). >>> To test the Foreign Table patch, 'Security Label Macro' patch must be >>> applied first as that is not committed yet. >>> >>> Please find attached Foreign Table Patch. >>> >>> Thanks, >>> Khushboo >>> >>> On Tue, Feb 23, 2016 at 6:53 PM, Khushboo Vashi < >>> khushboo.vashi@enterprisedb.com> wrote: >>> >>>> Hi, >>>> >>>> Please find attached patch for the Foreign Table Module. >>>> >>>> The patch will be modified after Types module implementation as we need >>>> to populate Base Type and some Type related validations from the Types >>>> module. >>>> >>>> Please review it and let me know the feedback. >>>> >>>> Thanks, >>>> Khushboo >>>> >>> >>> >> >> >> -- >> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org) >> To make changes to your subscription: >> http://www.postgresql.org/mailpref/pgadmin-hackers >> >> > --001a11401516d0b4000531fea8ec Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Dave,

In PG 9.5, for For= eign Table Editing, below new functionalities are added:
<= /div>
  • ALTER [ COLUMN ] column_name SET STORAGE { PLAIN | EXTERNAL | EXT= ENDED | MAIN }
  • DISABLE TRIGGER [ trigger_name | ALL | US= ER ]
  • ENABLE TRIGGER [ trigger_name | ALL | USER ]=
  • ENABLE REPLICA TRIGGER trigger_name
  • ENABLE = ALWAYS TRIGGER trigger_name
  • SET WITH OIDS<= /li>
  • SET WITHOUT OIDS

As per our conversation yester= day, we need to incorporate these functionalities into pgAdmin4. Here I hav= e some queries regarding the implementation. Under the Foreign Table Node, = we don't have separate nodes for columns, triggers and constraints as t= able. So in order to add above Trigger related functionalities, we will hav= e to add Trigger Node under the Foreign Table. And If we add Triggers, then= Do we need to add Columns and Constraints as separate nodes under the Fore= ign Table?


Thanks,

=

= Khushboo





<= p>






On F= ri, Apr 29, 2016 at 12:20 PM, Neel Patel <neel.patel@enterprised= b.com> wrote:
Hi Khushboo,

Below are the observations.
<= ul>
  • When we create the new Foreign Table with column name and types then= it shows NULL along with column name and type in properties tab.
  • =
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0e.g.=C2=A0column_1 xml= [] NULL=C2=A0
    • Once we inherits the table from another table th= en column and another parameters of inherited table should not allowed to c= hange.
    • When we create any foreign table then same foreign table is = also listed under "Tables" node.
    • SQL is not generated pro= perly. Please find below SQL which gives error during execution.
    <= div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0CREATE FOREIGN TABLE public.te= st_2
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(id1 integer NOT NU= LL DEFAULT12 COLLATEpg_catalog."POSIX")
    =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0SERVER fsrv;
      <= li>When we create the new foreign table with security label then no SQL is = generated for security label.
    • In Edit mode, when we provide securit= y label with both value "provider" and "security label"= then security label is displayed NULL
    =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 e.g.=C2=A0 SECURITY LABEL FOR frgn_table ON FOREIGN TA= BLE public.fsrv_table IS NULL;
    • During creation = of the column, when we remove the collation then it gives below error.
    • =
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0TypeError:= item is undefined
    • Delete/Drop cascade functionalit= y is not working, we are getting below error.
    =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0TypeError: self.canDrop.apply is n= ot a function
    • When we edit the foreign table an= d try to remove the existing "Data Type" of column then it gives = below error.
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= TypeError: this.dataAdapter is null
    • Create the= new foreign table and click on ADD button in Column tab and do not provide= any column name and data type. Need to do proper validation in Column tab = for all parameters. Currently if user do not provide any value then wrong S= QL is getting generated.
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0CREATE FOREIGN TABLE public.test_4
    =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0(None None NULL)
    =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 SERVER test_fsrv;
    • When = we do not provide the Check parameters in constraint then it gives SQL synt= ax error.
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0CREAT= E FOREIGN TABLE public.test_5
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0()
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0S= ERVER test_fsrv;

    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 ALTER FOREIGN TABLE public.test_5
    =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 ADD CONSTRAINT test CHECK () NOT VALID;
    • If we edit foreign table and change the schema then it giv= es below error.
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 IndexError: list index out of range
    • We shou= ld have proper indentation in the SQL tab once we give the parameters. Curr= ently it looks like below for "Options" value.
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 CREATE FOREIGN TABLE "1_tes= t"."5_test"
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 ()
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SE= RVER asas
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= OPTIONS (test1 'test2'
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 , test3 'test4');
    • If user = provide foreign table name and do not provide foreign server and click on S= QL tab then we are getting error on browser side as below. We should have p= roper error handling in this case.
    =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0Couldn't find the required parameter (ftsrvn= ame).
    • Create the foreign table, add the const= raint and do not provide any constraint information then SQL generated is w= rong.
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0CREATE FO= REIGN TABLE "1_test"."9_test"
    =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0()
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0SERVER test_fsrv;

    =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 ALTER FOREIGN TABLE "1_test"."9_tes= t"
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ADD CONS= TRAINT None CHECK ();
    • When we click on the fo= reign table collection node then "Comment" column is blank even t= hough we have comment in the foreign table.
    • Create the foreign tabl= e on PG 9.1 and after pressing Save button we are getting below error.
    • =
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "the= JSON object must be str, not 'list'"
      =
    • When we delete the options parameters then it gives SQL error because D= ROP statement does not include the value.
    =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ALTER FOREIGN TABLE public.test_12
    =
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 OPTIONS= ( DROP ser2 'val2');
    • There are some = new functionality added in PG 9.5. Do we really need to implement ? Need to= discuss with Dave/Ashesh. Below are the new functionality.
    = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0- In create foreign = table,we have added column constraint but "table constraint" is a= dded from 9.5.Do we really = require to add table constraint ?
    =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0- In alter foreign table, below are the new = functionality added.
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A01.=C2=A0 ALTER [ COLUMN ] column_name SET= STORAGE { PLAIN | EXTERNAL | EXTENDED | MAIN }
    =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A02.=C2=A0 DISABLE= TRIGGER [ trigger_name | ALL | USER ]
    =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A03.=C2=A0 ENABLE TRIGGER= [ trigger_name | ALL | USER ]
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A04.=C2=A0 ENABLE REPLICA TRIGGER t= rigger_name
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A05.=C2=A0 ENABLE ALWAYS TRIGGER trigger_name
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A06.=C2=A0 SET WITH OIDS
    =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A07.=C2=A0 SET WITHOUT OIDS

    Do let us know in case of any queries.

    Thanks,
    Neel Patel
    On Tue, Apr 5, 2016 at 2:27 P= M, Khushboo Vashi <khushboo.vashi@enterprisedb.com> wrote:
    Hi,

    Please find updated patch for the Forei= gn Table Module.

    This patch is dependent on=C2=A0<= /div>
    1. Backgrid Depscell Patch, (submitted by me)
    2. NodeAj= axOptionsCell Transform change patch, on which Ashesh and Murtuza are worki= ng

    Thanks,
    Khushboo

    =


    On Wed, Feb 24, 2016 at 2:57 PM, Khushboo Vash= i <khushboo.vashi@enterprisedb.com> wrote:
    =
    Hi,
    =
    I have updated the Foreign Table module as below:

    - Used 'NodeByListControl' to get schemas, in the foreign_= table.js file as suggested by Ashesh to avoid code redundancy.

    - Applied 'Security Label Macro'=C2=A0 Patch (Implemented b= y Harshal).
    =C2=A0 To test the Foreign Table patch, 'Security Labe= l Macro' patch must be applied first as that is not committed yet.
    <= /div>

    Please find attached Foreign Table Patch.

    <= /div>
    Thanks,
    Khushboo

    On Tue, Feb 23, 2016 at 6:53 PM, Khushboo= Vashi <khushboo.vashi@enterprisedb.com> wrote= :
    Hi,

    Please find= attached patch for the Foreign Table Module.

    The patch will be modi= fied after Types module implementation as we need to populate Base Type=C2= =A0 and some Type related validations from the Types module.

    Please = review it and let me know the feedback.

    Thanks,
    Khushboo




    --
    Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
    To make changes to your subscription:
    http://www.postgresql.org/mailpref/pgadmin-hackers=



    --001a11401516d0b4000531fea8ec--