Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1azgN5-0008Nm-1y for pgadmin-hackers@arkaria.postgresql.org; Mon, 09 May 2016 08:16:55 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1azgN4-0001k3-Kj for pgadmin-hackers@arkaria.postgresql.org; Mon, 09 May 2016 08:16:54 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1azgMq-0000yq-52 for pgadmin-hackers@postgresql.org; Mon, 09 May 2016 08:16:40 +0000 Received: from mail-pa0-x233.google.com ([2607:f8b0:400e:c03::233]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1azgMm-0002j6-Bi for pgadmin-hackers@postgresql.org; Mon, 09 May 2016 08:16:39 +0000 Received: by mail-pa0-x233.google.com with SMTP id bt5so69668672pac.3 for ; Mon, 09 May 2016 01:16:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc:message-id:references :to; bh=pIcdAd1rxg49rfGS/HbFKmkiSFboAtuU9bEkcx8/nz0=; b=iexPgiG9WuK8HIfz9tp1b+wcA9bKZnCNpZH1AT+xThe9TA5MTZD/snm84gllQ7915b EvReJ13d6WmSlfLrIeKZjuuSj5DnhX+XODXvFHanQifSnrbtWeBfulUBpgphrNqG3tba mAL7+Ygix+MytkWaHGXAIX9DGbRRdBWYtEIj4Wo02Q8U9HYRp+bsNtDVnoyN4qAoyfxP gfZkqOFJyQsMK3gzGuS2FLnQviky7d0atX+EAIO21ypkR82Bnq47R5+evDkgZIvLQwxV bRZGxI4O2AEht39vfylrMwPICW/JaCqzF6GBsQK1J29+kBporR6mHG2sXANcx6P6hqUp AoXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=pIcdAd1rxg49rfGS/HbFKmkiSFboAtuU9bEkcx8/nz0=; b=mZS9fM+p3EsbUeXXmmIjj0HhU09dIsqxdMKtuUVaJpwo5SVoxA8sEGVciNVgme8cvq 0WH4i54Xu4diYGK90ziSjKksdQYGb65eYwKGW4Om7Q7z1ABXersvhD2yfGdpC2eJx199 qHExjElC4gFRAJHpnRjteJ39B8+JAqKj8q8TVpeQc1LtRHujVdVBYusyPpZ2NBCWp64u uN6GWd06P086X0tB+CdD7pmJZuPMEfGXqmhW8WDC7ehVH18EOytB8LqZkmwCjX0xNmdX sNhoa5EZqbIKbBvmmLFqIgq19/gNGO56cKCqEjY9khKZEezwftOfDl5ejz3biVXOBFXr TsRA== X-Gm-Message-State: AOPr4FUhl5a7JSjedKLb2p7r3sIYJtDAHbCm6r/Tqsj6yPh22dY6KSGi8tY4SAVQMKqhce1b X-Received: by 10.66.145.35 with SMTP id sr3mr48129730pab.82.1462781794579; Mon, 09 May 2016 01:16:34 -0700 (PDT) Received: from [172.24.35.232] ([59.162.78.200]) by smtp.gmail.com with ESMTPSA id 28sm38338971pfr.89.2016.05.09.01.16.32 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 May 2016 01:16:34 -0700 (PDT) Content-Type: multipart/alternative; boundary="Apple-Mail=_72BAAFC0-E3E0-4666-9864-35AEC26B0E18" Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: [pgAdmin4] [Patch]: Foreign Table Module From: Murtuza Zabuawala In-Reply-To: <928839C0-1CD1-4307-9C62-6A693D6F0533@enterprisedb.com> Date: Mon, 9 May 2016 13:46:30 +0530 Cc: Neel Patel , pgadmin-hackers Message-Id: <2BC9FA40-F05D-48AA-8796-29808FC15498@enterprisedb.com> References: <58B5FCCE-9882-44C0-B990-8BF5D2FA17DC@enterprisedb.com> <928839C0-1CD1-4307-9C62-6A693D6F0533@enterprisedb.com> To: Khushboo Vashi X-Mailer: Apple Mail (2.2104) 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 --Apple-Mail=_72BAAFC0-E3E0-4666-9864-35AEC26B0E18 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi Khushboo, Please find comments as below, (Tested with Python3) 1) Default string value is not quoted properly which causing SQL to = break, here default string should be 'my test string' for myCol2. CREATE FOREIGN TABLE "Test123"."test1_Server" ("myCol" bigint NOT NULL DEFAULT 213 COLLATE pg_catalog."C", "myCol2" character varying(50) NOT NULL DEFAULT my test string COLLATE = pg_catalog."C.UTF-8") INHERITS ("Test123".abc, pem.chart) SERVER test_fw_server; 2) When Length & Precision, does not clear when user selects another = data type - First select Numeric provide Length & Precision and then choose = abstime=20 data type which have neither Length & Precision=20 - It will not clear/ not allow user to clear old values & generates = wrong SQL ALTER FOREIGN TABLE "Test123"."test1_TT1" ADD COLUMN col1 abstime(50 , 2) NOT NULL COLLATE pg_catalog."C"; 3) I am allowed to select self table as inherited table ALTER FOREIGN TABLE pem."test1_TT1" INHERIT pem."test1_TT1"; 4) Wrong SQL generated for array like data types ALTER FOREIGN TABLE pem."test1_TT1" ADD COLUMN name character[](50 ) NOT NULL COLLATE = pg_catalog."POSIX"; Correct SQL: =20 ALTER FOREIGN TABLE pem."test1_TT1" ADD COLUMN name character(50)[] NOT NULL COLLATE = pg_catalog."POSIX"; 5) I am allowed to enter duplicate options but as per postgres = documentation=20 we should not allow duplicate options=20 ALTER FOREIGN TABLE pem."test1_TT1" OPTIONS (ADD op1 'val1'); ALTER FOREIGN TABLE pem."test1_TT1" OPTIONS (ADD op1 'val1'); ALTER FOREIGN TABLE pem."test1_TT1" OPTIONS (ADD op1 'val2'); 6) Created table with Special name (eg: table name =3D> "@Test#" ) & it = breaks when we clicks on it. File = "/home/murtuza/projects/pgadmin4/web/pgadmin/browser/server_groups/servers= /databases/schemas/foreign_tables/__init__.py", line 414, in properties data =3D self._fetch_properties(gid, sid, did, scid, foid) File = "/home/murtuza/projects/pgadmin4/web/pgadmin/browser/server_groups/servers= /databases/schemas/foreign_tables/__init__.py", line 982, in = _fetch_properties c['typlen'] =3D int(typlen) TypeError: int() argument must be a string, a bytes-like object or a = number, not 'list' 7) While dropping any foreign table gives this error but table gets = deleted from browser tree. s/databases/schemas/foreign_tables/__init__.py", line 414, in properties data =3D self._fetch_properties(gid, sid, did, scid, foid) File = "/home/murtuza/projects/pgadmin4/web/pgadmin/browser/server_groups/servers= /databases/schemas/foreign_tables/__init__.py", line 982, in = _fetch_properties c['typlen'] =3D int(typlen) TypeError: int() argument must be a string, a bytes-like object or a = number, not 'list' Can be added into TODO: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 1) We should not allowed user to Inherits from catalog tables like = pg_catalog.pg_type; 2) Minor SQL alignment when only server & table name was given=20 CREATE FOREIGN TABLE "Test123"."test1_Server" () SERVER test_fw_server; Expected: --------- CREATE FOREIGN TABLE "Test123"."test1_Server" () SERVER test_fw_server; 3) Collation client side validation missing for columns, not every data = type support Collations, For other data types it should be disable just like Length & = Precision. Regards, Murtuza > On 09-May-2016, at 10:43 am, Murtuza Zabuawala = wrote: >=20 > Hi Khushboo, >=20 > No I did not. let me apply it and try again. >=20 > Thanks, > Murtuza >=20 >=20 >> On 06-May-2016, at 10:15 pm, Khushboo Vashi = > wrote: >>=20 >> Hi Murtuza, >>=20 >> Have you applied Dependent Cell patch on this? As the Foreign table = is dependent on that. >>=20 >> Thanks, >> Khushboo >>=20 >> On 6 May 2016 20:39, "Murtuza Zabuawala" = > wrote: >> Hi Khushboo, >>=20 >> Please find comments as below, >>=20 >> I pulled latest version of code and then I applied v2 patch. >>=20 >>=20 >> 1) Once applying patch, When I re-started pgAdmin4 server again, I = got below error (Screenshot is also attached), >> ( FYI, I was not able to re-produce it again second time. ) >>=20 >> File = "/Users/murtuza/Desktop/pgadmin4/web/pgadmin/utils/__init__.py", line = 37, in create_module_preference >> self.preference =3D Preferences(self.name , = None) >> File = "/Users/murtuza/Desktop/pgadmin4/web/pgadmin/utils/preferences.py", line = 261, in __init__ >> db.session.commit() >> =E2=80=A6.. >> =E2=80=A6.. >> cursor.execute(statement, parameters) >> sqlalchemy.exc.OperationalError: (OperationalError) database is = locked 'INSERT INTO module_preference (name) VALUES (?)' = ('NODE-foreign-table=E2=80=99,) >>=20 >>=20 >> 2) I am not able to create/open Foreign table node as I am getting = errors from JS side (when I expand the schema node & do not get Create = context menu as well) >> Please find screenshots for both scenario. >>=20 >>=20 >> >>=20 >>=20 >>> On 06-May-2016, at 3:55 pm, Khushboo Vashi = > wrote: >>>=20 >>> Hi, >>>=20 >>> Please find the attached patch for the Foreign Table Node with fixed = issues. >>>=20 >>> Thanks, >>> Khushboo >>>=20 >>> On Fri, Apr 29, 2016 at 12:20 PM, Neel Patel = > = wrote: >>> Hi Khushboo, >>>=20 >>> 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=20 >>> I think if its NOT NULL, then it should be NULL and it is default, = so this should be okay.=20 >>> Once we inherits the table from another table then column and = another parameters of inherited table should not allowed to change. >>> Done=20 >>> When we create any foreign table then same foreign table is also = listed under "Tables" node. >>> This bug is related to Table node and Harshal is working on this = issue.=20 >>> 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; >>> Done=20 >>> When we create the new foreign table with security label then no SQL = is generated for security label. >>> Done=20 >>> 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; >>> Done=20 >>> During creation of the column, when we remove the collation then it = gives below error. >>> TypeError: item is undefined >>> Done=20 >>> Delete/Drop cascade functionality is not working, we are getting = below error. >>> TypeError: self.canDrop.apply is not a function >>> Done=20 >>> 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 >>> Done=20 >>> 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; >>> Done=20 >>> 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; >>>=20 >>> ALTER FOREIGN TABLE public.test_5 >>> ADD CONSTRAINT test CHECK () NOT VALID; >>> Done=20 >>> If we edit foreign table and change the schema then it gives below = error. >>> IndexError: list index out of range >>> Done=20 >>> 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'); >>> Done=20 >>> 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). >>> Done=20 >>> 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; >>>=20 >>> ALTER FOREIGN TABLE "1_test"."9_test" >>> ADD CONSTRAINT None CHECK (); >>> Done=20 >>> When we click on the foreign table collection node then "Comment" = column is blank even though we have comment in the foreign table. >>> Done=20 >>> 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'" >>> Done=20 >>> 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'); >>> Done=20 >>> 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 >>>=20 >>> As per the discussion, we will add these functionality into the next = phase.=20 >>> Do let us know in case of any queries. >>>=20 >>> Thanks, >>> Neel Patel >>>=20 >>> On Tue, Apr 5, 2016 at 2:27 PM, Khushboo Vashi = > wrote: >>> Hi, >>>=20 >>> Please find updated patch for the Foreign Table Module. >>>=20 >>> This patch is dependent on=20 >>> 1. Backgrid Depscell Patch, (submitted by me) >>> 2. NodeAjaxOptionsCell Transform change patch, on which Ashesh and = Murtuza are working >>>=20 >>> Thanks, >>> Khushboo >>>=20 >>>=20 >>>=20 >>>=20 >>> On Wed, Feb 24, 2016 at 2:57 PM, Khushboo Vashi = > wrote: >>> Hi, >>>=20 >>> I have updated the Foreign Table module as below: >>>=20 >>> - Used 'NodeByListControl' to get schemas, in the foreign_table.js = file as suggested by Ashesh to avoid code redundancy. >>>=20 >>> - Applied 'Security Label Macro' Patch (Implemented by Harshal).=20 >>> To test the Foreign Table patch, 'Security Label Macro' patch must = be applied first as that is not committed yet. >>>=20 >>> Please find attached Foreign Table Patch. >>>=20 >>> Thanks, >>> Khushboo >>>=20 >>> On Tue, Feb 23, 2016 at 6:53 PM, Khushboo Vashi = > wrote: >>> Hi, >>>=20 >>> Please find attached patch for the Foreign Table Module. >>>=20 >>> 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. >>>=20 >>> Please review it and let me know the feedback. >>>=20 >>> Thanks, >>> Khushboo >>>=20 >>>=20 >>>=20 >>>=20 >>> -- >>> Sent via pgadmin-hackers mailing list = (pgadmin-hackers@postgresql.org ) >>> To make changes to your subscription: >>> http://www.postgresql.org/mailpref/pgadmin-hackers = >>>=20 >>>=20 >>>=20 >>> >>> --=20 >>> Sent via pgadmin-hackers mailing list = (pgadmin-hackers@postgresql.org ) >>> To make changes to your subscription: >>> http://www.postgresql.org/mailpref/pgadmin-hackers = >>=20 >=20 --Apple-Mail=_72BAAFC0-E3E0-4666-9864-35AEC26B0E18 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

Hi Khushboo,

Please find comments as below,
(Tested = with Python3)

1) Default string = value is not quoted properly which causing SQL to break, here default = string should be 'my test string' for myCol2.

CREATE FOREIGN TABLE = "Test123"."test1_Server"
("myCol" bigint NOT NULL = DEFAULT 213 COLLATE pg_catalog."C",
"myCol2" = character varying(50) NOT NULL DEFAULT my test string COLLATE = pg_catalog."C.UTF-8")
    INHERITS = ("Test123".abc, pem.chart)
    SERVER = test_fw_server;

2) When Length & Precision, does not = clear when user selects another data type
- First = select Numeric provide Length & Precision and then choose = abstime 
  data type which have neither = Length & Precision 
- It will not clear/ = not allow user to clear old values & generates wrong SQL

ALTER FOREIGN TABLE = "Test123"."test1_TT1"
    ADD COLUMN col1 = abstime(50 , 2) NOT NULL COLLATE pg_catalog."C";

3) I am allowed to = select self table as inherited table

ALTER FOREIGN TABLE pem."test1_TT1" = INHERIT pem."test1_TT1";

4) Wrong SQL generated for array like data = types

ALTER = FOREIGN TABLE pem."test1_TT1"
    ADD = COLUMN name character[](50 ) NOT NULL COLLATE = pg_catalog."POSIX";

Correct SQL:
   
ALTER FOREIGN TABLE pem."test1_TT1"
 =      ADD COLUMN name character(50)[] NOT NULL COLLATE = pg_catalog."POSIX";

5) I am allowed to enter duplicate options = but as per postgres documentation 
  =  we should not allow duplicate options 
ALTER FOREIGN TABLE = pem."test1_TT1"
    OPTIONS (ADD op1 = 'val1');

ALTER = FOREIGN TABLE pem."test1_TT1"
    OPTIONS = (ADD op1 'val1');

ALTER FOREIGN TABLE pem."test1_TT1"
 =   OPTIONS (ADD op1 'val2');

6) Created table with = Special name (eg: table name =3D> "@Test#" ) & it breaks when we = clicks on it.

  File = "/home/murtuza/projects/pgadmin4/web/pgadmin/browser/server_groups/servers= /databases/schemas/foreign_tables/__init__.py", line 414, in = properties
    data =3D = self._fetch_properties(gid, sid, did, scid, foid)
  File = "/home/murtuza/projects/pgadmin4/web/pgadmin/browser/server_groups/servers= /databases/schemas/foreign_tables/__init__.py", line 982, in = _fetch_properties
    c['typlen'] =3D = int(typlen)
TypeError: int() argument must be a = string, a bytes-like object or a number, not 'list'

7) = While dropping any foreign table gives this error but table = gets deleted from browser tree.

s/databases/schemas/foreign_tables/__init__.py", line 414, in = properties
    data =3D = self._fetch_properties(gid, sid, did, scid, foid)
  File = "/home/murtuza/projects/pgadmin4/web/pgadmin/browser/server_groups/servers= /databases/schemas/foreign_tables/__init__.py", line 982, in = _fetch_properties
    c['typlen'] =3D = int(typlen)
TypeError: int() argument must be a = string, a bytes-like object or a number, not 'list'


Can be added into TODO:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D

1) We should not = allowed user to Inherits from catalog tables like = pg_catalog.pg_type;

2) Minor SQL alignment when only server = & table name was given 

CREATE FOREIGN TABLE = "Test123"."test1_Server"
()
    SERVER test_fw_server;

Expected:
---------
CREATE FOREIGN TABLE = "Test123"."test1_Server" ()
    SERVER = test_fw_server;

3) Collation client side validation missing = for columns, not every data type support Collations,
   For other data types it should be disable just = like Length & Precision.


Regards,
Murtuza



On = 09-May-2016, at 10:43 am, Murtuza Zabuawala <murtuza.zabuawala@enterprisedb.com> wrote:

Hi = Khushboo,

No I did = not. let me apply it and try again.

Thanks,
Murtuza


On 06-May-2016, at 10:15 pm, = Khushboo Vashi <khushboo.vashi@enterprisedb.com> wrote:

Hi Murtuza,

Have you applied = Dependent Cell patch on this? As the Foreign table is dependent on = that.

Thanks,
Khushboo

On 6 May 2016 20:39, "Murtuza Zabuawala" = <murtuza.zabuawala@enterprisedb.com> wrote:
Hi Khushboo,

Please find comments as = below,

I = pulled latest version of code and then I applied v2 patch.


1) Once applying patch, When I re-started pgAdmin4 server = again, I got below error (Screenshot is also attached),
   ( FYI, = I was not able to re-produce it again second time. = )

  File = "/Users/murtuza/Desktop/pgadmin4/web/pgadmin/utils/__init__.py", line = 37, in create_module_preference
    = self.preference =3D Preferences(self.name, None)
  = File "/Users/murtuza/Desktop/pgadmin4/web/pgadmin/utils/preferences.py", = line 261, in __init__
    db.session.commit()
=E2=80=A6..
=E2=80=A6..
    cursor.execute(statement, = parameters)
sqlalchemy.exc.OperationalError: = (OperationalError) database is locked 'INSERT INTO module_preference = (name) VALUES (?)' ('NODE-foreign-table=E2=80=99,)


2) I = am not able to create/open Foreign table node as I am getting errors = from JS side  (when I expand the schema node & do not get = Create context menu as well)
    = Please find screenshots for both scenario.


<Screenshot from 2016-05-06 08-00-19.png><Screenshot from 2016-05-06 07-59-45.png><Screen Shot 2016-05-06 at 8.18.12 = pm.png>


On 06-May-2016, at 3:55 pm, Khushboo Vashi <khushboo.vashi@enterprisedb.com> wrote:

Hi,

Please find the attached = patch for the Foreign Table Node with fixed issues.

Thanks,
Khushboo

On Fri, Apr 29, 2016 at 12:20 PM, = Neel Patel <neel.patel@enterprisedb.com> 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 
I think if its = NOT NULL, then it should be NULL and it is default, so this should be = okay.
  • Once we inherits the table from another table = then column and another parameters of inherited table should not allowed = to change.
Done
  • When we create = any foreign table then same foreign table is also listed under "Tables" = node.
This bug is = related to Table node and Harshal is working on this issue.
  • 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;
Done
  • When we create = the new foreign table with security label then no SQL is generated for = security label.
Done =
  • 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;
Done
  • During creation of the column, when we remove = the collation then it gives below error.
  •   =              TypeError: item is = undefined
    Done
    • Delete/Drop = cascade functionality is not working, we are getting below = error.
              =      TypeError: self.canDrop.apply is not a function
    Done
  • 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
    Done
  • 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;
    Done
    • 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;
    Done
    • If we edit = foreign table and change the schema then it gives below = error.
              =     IndexError: list index out of range
    Done
  • 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');
    Done =
    • 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).
    Done =
    • 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 = ();
    Done
    • When we click = on the foreign table collection node then "Comment" column is blank even = though we have comment in the foreign = table.
    Done
    • 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'"
    Done
  • 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');
    Done
    • 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

    As = per the discussion, we will add these functionality into the next phase. =
    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



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



    = --Apple-Mail=_72BAAFC0-E3E0-4666-9864-35AEC26B0E18--