Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aveEP-0007Xo-Cy for pgadmin-hackers@arkaria.postgresql.org; Thu, 28 Apr 2016 05:11:17 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1aveEO-0000UO-Vu for pgadmin-hackers@arkaria.postgresql.org; Thu, 28 Apr 2016 05:11:17 +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 1aveEO-0000UI-H2 for pgadmin-hackers@postgresql.org; Thu, 28 Apr 2016 05:11:16 +0000 Received: from mail-pa0-x231.google.com ([2607:f8b0:400e:c03::231]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1aveEK-0007lD-CL for pgadmin-hackers@postgresql.org; Thu, 28 Apr 2016 05:11:15 +0000 Received: by mail-pa0-x231.google.com with SMTP id iv1so27915491pac.2 for ; Wed, 27 Apr 2016 22:11:12 -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 :content-transfer-encoding:message-id:references:to; bh=93YiwSq+BG31wJbqOGbHZvFOwXmmTW92WZf2sW3Uhp8=; b=gAL37pbFGxaQI4brGujbPSdgRN25ZZOCl9K19gsC1wmgq9xK3CntSeZbVPHEoZueI+ 3KL8Vtk6RKJV9fd2WqLR/MGyPRi965lMG/BU1tMLcwoqcD0Yf9CmB/KYRUqpX8xy6/Tl 4zEwgwVj8oubwqlMF1PhGD6bV8kZ5DyfNzeBBTtgY2fp8TXywZrjJ2gTL672Uriiqjwq 4IrCybypYOYxBwJWW+XWlatF0tynCzY6F76Yw+B8HIBQNb5xwjgLzoQvq2n13xxOsGIo iXt1slBmMdEFS4UhJc1yMxEHG6nPd3z1bIUjyfh+Ycv58Om3DZGWbD45yBNoA7f1TLq2 RcQg== 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 :content-transfer-encoding:message-id:references:to; bh=93YiwSq+BG31wJbqOGbHZvFOwXmmTW92WZf2sW3Uhp8=; b=H1I/JC4zF8gaSkao6zJybJejRGhZXpYb6IbnbLQDg6O7ZFhF2Qj6i5djBb/TCrT3Cu rPFtmiPKnpxVduNOOkgCxVkMugYSSQlQrszGi5Kr5dPsY9l1TIiw9+0+MMiyHZYT+6ax RwoZ9NFBNuIhtapa3BKx0w9EcU1zDmxQJEtT7xKmWgSRSBeaum1eiZ/pFBW86X6478Z3 /WUXJ3/IyMUzB6N54Ev1/0I33QMuZWF68li6xZj+i4ec5xUMcACLAtUDU0pLgdTF4sNp X7e1ptQgWyeFla/fpyunlPcRb8k7bfZwd+iRJ+HeUHo+ilY0xQdCSVEeBIV/kNIJspvQ wBfg== X-Gm-Message-State: AOPr4FXhH+R3cmXixYMZL9Q8lmbdMcrCe5M+BJY0CSePooVKSNE6j6IpTPLq/Bd0/xD6rtoa X-Received: by 10.66.171.164 with SMTP id av4mr17490343pac.135.1461820270203; Wed, 27 Apr 2016 22:11:10 -0700 (PDT) Received: from [172.24.35.232] ([59.162.78.200]) by smtp.gmail.com with ESMTPSA id fh14sm11126882pab.31.2016.04.27.22.11.07 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 27 Apr 2016 22:11:09 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: [PATCH] Tables node (pgAdmin4) From: Murtuza Zabuawala In-Reply-To: Date: Thu, 28 Apr 2016 10:41:07 +0530 Cc: Harshal Dhumal , pgadmin-hackers , Surinder Kumar Content-Transfer-Encoding: quoted-printable Message-Id: <00E570E4-0E2D-4E8D-9978-9FE36CFAA2AD@enterprisedb.com> References: To: Thom Brown 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 Hi Thom, Thank you for your inputs, Will work on it & send updated patch again. Regards, Murtuza > On 27-Apr-2016, at 7:04 pm, Thom Brown wrote: >=20 > On 27 April 2016 at 13:43, Thom Brown wrote: >> On 27 April 2016 at 10:22, Harshal Dhumal >> wrote: >>>=20 >>> Hi, >>>=20 >>> PFA attached patches for table node and all table child nodes. >>>=20 >>> This patch includes below nodes, >>>=20 >>> 1) Table node -- Initial patch by Murtuza,= constraints compatibility by Harshal. >>> 2) Column node -- by Murtuza. >>> 3) Index node -- by Murtuza. >>> 4) Trigger node -- by Murtuzz. >>> 6) Rules node -- by Surinder. >>> 7) Constraints nodes: >>> i] Index Constraint -- Initial patch by Harshal, = Integration with table node by Murtuza. >>> ii] Foreign key -- Initial patch and Integr= ation with table node by Harshal. >>> iii] Check constraint -- Initial patch and Integrat= ion with table node by Harshal. >>> iv] Exclusion constraint -- Initial patch and Integratio= n with table node by Harshal. >>>=20 >>> Please apply patches in following order as all of them depends on each = other. >>>=20 >>> Order: Table Node ----> Index constraint ---> remaining patches in any= order. >>>=20 >>>=20 >>=20 >> Nice work. Here's some initial feedback from a very quick play around. >>=20 >> On the Create table editor, in the Advance tab (which should probably >> be labelled "Advanced"), the Like section should grey out the "With *" >> values if no relation is selected in the drop-down box. >>=20 >> The way primary keys are defined are kinda awkward. It might be >> useful to provide some kind of checkbox on the initial column list >> that tells it which columns are involved in the primary key, then the >> user could just select which ones they want. If they want to refine >> it, they could edit it in the Constraints > Primary Key section. >>=20 >> I'm getting weird spacing in the SQL output. Here's an example: >>=20 >> CREATE UNLOGGED TABLE public.test >> ( >> id integer COLLATE pg_catalog."de_DE.utf8" NOT NULL DEFAULT -1, >> stuff text COLLATE pg_catalog."C.UTF-8" DEFAULT "hello", >> CONSTRAINT pk PRIMARY KEY (id, stuff) WITH (FILLFACTOR=3D33) DEFERRAB= LE >> ) >> WITH ( >> OIDS =3D TRUE, >> FILLFACTOR =3D 88, >> autovacuum_enabled =3D TRUE, >> autovacuum_analyze_scale_factor =3D 0.33, >> autovacuum_analyze_threshold =3D 30, >> autovacuum_freeze_max_age =3D 3333333, >> autovacuum_vacuum_cost_delay =3D 30, >> autovacuum_vacuum_cost_limit =3D 3, >> autovacuum_vacuum_scale_factor =3D 0.33, >> autovacuum_vacuum_threshold =3D 33, >> autovacuum_freeze_min_age =3D 3300000, >> autovacuum_freeze_table_age =3D 333000000 >> ) >> TABLESPACE pg_default; >>=20 >> ALTER TABLE public.test >> OWNER to thom; >> GRANT ALL ON TABLE public.test TO thom; >>=20 >>=20 >> COMMENT ON TABLE public.test >> IS 'This is just a test table'; >>=20 >> COMMENT ON COLUMN public.test.id >> IS 'the main ID'; >>=20 >> ALTER TABLE public.test >> ALTER COLUMN id >> SET (n_distinct=3D'0.2'); >> COMMENT ON CONSTRAINT pk ON public.test >> IS 'primary key test' >>=20 >> Note there are 2 blank lines after the GRANT ALL ON TABLE line, and >> none before the COMMENT ON CONSTRAINT line. >>=20 >> This SQL fails because collations aren't allowed on integer columns, >> and the DEFAULT value for the column named stuff doesn't quote it as a >> string literal, so it's looking for a column called "hello". >>=20 >> There's also no way to view the autovacuum options I defined other >> than the SQL pane. >=20 > A couple more: >=20 > If I go to create a new table, give it a name, select a table to > inherit from, and then do nothing else, I get an error: >=20 > ERROR: syntax error at or near "INHERITS" > LINE 2: INHERITS (test) > ^ >=20 > This is because no column list was provided, and in this case, an > empty one would be needed. So instead of: >=20 > CREATE TABLE public.test2 > ( > ) > INHERITS (test) > WITH ( > OIDS =3D FALSE > ) > TABLESPACE pg_default; >=20 > It should be: >=20 > CREATE TABLE public.test2 > INHERITS (test) > WITH ( > OIDS =3D FALSE > ) > TABLESPACE pg_default; >=20 >=20 > If I go to create another new table, give it a name, and then in the > Like section on the Advance tab, I select a table, and enable each of > the With * options, the following SQL is produced: >=20 > CREATE TABLE public.test2 > LIKE public.test > INCLUDING DEFAULTS > INCLUDING CONSTRAINTS > INCLUDING INDEXES > INCLUDING STORAGE > INCLUDING COMMENTSWITH ( > OIDS =3D FALSE > ) > TABLESPACE pg_default; >=20 > The LIKE statement should appear in the column list section, so should > be surrounded in parentheses. Also, the WITH statement here is not on > a new line. >=20 > So this should be: >=20 > CREATE TABLE public.test2 > ( > LIKE public.test > INCLUDING DEFAULTS > INCLUDING CONSTRAINTS > INCLUDING INDEXES > INCLUDING STORAGE > INCLUDING COMMENTS > ) > WITH ( > OIDS =3D FALSE > ) > TABLESPACE pg_default; >=20 > Regards >=20 > Thom --=20 Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers