Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1az2y6-0007XY-0a for pgadmin-hackers@arkaria.postgresql.org; Sat, 07 May 2016 14:12:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1az2y5-00023Z-Jc for pgadmin-hackers@arkaria.postgresql.org; Sat, 07 May 2016 14:12:29 +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 1az2xs-0001pV-Ae for pgadmin-hackers@postgresql.org; Sat, 07 May 2016 14:12:16 +0000 Received: from mail-oi0-x230.google.com ([2607:f8b0:4003:c06::230]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1az2xo-0007vK-2W for pgadmin-hackers@postgresql.org; Sat, 07 May 2016 14:12:15 +0000 Received: by mail-oi0-x230.google.com with SMTP id v145so168023723oie.0 for ; Sat, 07 May 2016 07:12:11 -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=xjefMsPL2yaLC4o86Wy1Tu1hrTbm0VbQOhbrEcHe7Hs=; b=u6WXA1kow3bS/jQnEm76Gmjf4PlEvvZn+Y+347ReaQhksLnOzmwl0T+02tJcSa0tc1 J4jswC3NgQ7mkPF5M0i5AjPm0X9eJspEhuwXu+AZT9TilMtoE1gEB29tjQKq4p949hwe j3fWmLilCMRX69a9n6dt0eEi/rBOa+XryfZEttVQxjhbSG9YiWbwnxi8kkhDPbZjFMRq 9Eegf2rqYg+WCfbqABQPHi75YOVlID7HXnxhVqZPqyCQAd8Kt+noXeOtLsdq7K21Z06b Rj8sKyYKZ9tjpVfm7Yjl2tcB6j6ErQXtJN5olRrQZ5XdsQIhDxE7xY9fagEIdbyiOMfZ 0bgw== 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=xjefMsPL2yaLC4o86Wy1Tu1hrTbm0VbQOhbrEcHe7Hs=; b=RnhDUuBeXWXw451l6Rw+W4OuwRGqSM18uYeVmeYlo07RTFF8sJegP3TcYaQX7GmhX3 q31Pjpy8GmMErj7yGKZrq1ZdbtAHzNSb4svkd0/911ntRAhWYg5lQyR0rLZsfLAnGX0A kNRsxBMqolB/k2LBsuA21noIRO2FVgYXAzZEof7vzOuH5/Z2YhN9XeCSxRhdekvC3IS+ eXamGzPjmawl74Rr9K3SZ956qWtVORXiUQWHfmxDrbJh+fUI9t2Tkif6ijWLtOJ+aUTH 4u2vBWuDyCBmXSNSTTM1V/JFThgdW5wkWBgcwZXK4VEBiOsu1E9/ZwMakCXlUz6Gx6WE PsSg== X-Gm-Message-State: AOPr4FXjQ0yXqfgX5qQzNa2YECOmcBWVKzxQCTqbdiqBCBE0w38Xw4znxuoT8pFrqovhzF9CbURwb5x1sdeDog/7 MIME-Version: 1.0 X-Received: by 10.202.204.21 with SMTP id c21mr10421699oig.188.1462630330062; Sat, 07 May 2016 07:12:10 -0700 (PDT) Received: by 10.157.54.226 with HTTP; Sat, 7 May 2016 07:12:09 -0700 (PDT) In-Reply-To: References: Date: Sat, 7 May 2016 19:42:09 +0530 Message-ID: Subject: Re: [PATCH] Tables node (pgAdmin4) From: Harshal Dhumal To: Thom Brown Cc: pgadmin-hackers , Murtuza Zabuawala , Surinder Kumar Content-Type: multipart/alternative; boundary=001a1135240042ee1d05324129ae 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 --001a1135240042ee1d05324129ae Content-Type: text/plain; charset=UTF-8 Hi, -- *Harshal Dhumal* *Software Engineer * EenterpriseDB On Wed, Apr 27, 2016 at 6:13 PM, Thom Brown wrote: > On 27 April 2016 at 10:22, Harshal Dhumal > wrote: > > > > Hi, > > > > PFA attached patches for table node and all table child nodes. > > > > This patch includes below nodes, > > > > 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 > Integration with table node by Harshal. > > iii] Check constraint -- Initial patch and > Integration with table node by Harshal. > > iv] Exclusion constraint -- Initial patch and > Integration with table node by Harshal. > > > > Please apply patches in following order as all of them depends on each > other. > > > > Order: Table Node ----> Index constraint ---> remaining patches in any > order. > > > > > > Nice work. Here's some initial feedback from a very quick play around. > > 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. > > Fixed > 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. > I have added functionality. However check box will only be enabled in expanded mode of column (by clicking on edit button which at left side of delete button). To enable check box in grid mode this patch needs to be committed. > > I'm getting weird spacing in the SQL output. Here's an example: > > 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=33) DEFERRABLE > ) > WITH ( > OIDS = TRUE, > FILLFACTOR = 88, > autovacuum_enabled = TRUE, > autovacuum_analyze_scale_factor = 0.33, > autovacuum_analyze_threshold = 30, > autovacuum_freeze_max_age = 3333333, > autovacuum_vacuum_cost_delay = 30, > autovacuum_vacuum_cost_limit = 3, > autovacuum_vacuum_scale_factor = 0.33, > autovacuum_vacuum_threshold = 33, > autovacuum_freeze_min_age = 3300000, > autovacuum_freeze_table_age = 333000000 > ) > TABLESPACE pg_default; > > ALTER TABLE public.test > OWNER to thom; > GRANT ALL ON TABLE public.test TO thom; > > > COMMENT ON TABLE public.test > IS 'This is just a test table'; > > COMMENT ON COLUMN public.test.id > IS 'the main ID'; > > ALTER TABLE public.test > ALTER COLUMN id > SET (n_distinct='0.2'); > COMMENT ON CONSTRAINT pk ON public.test > IS 'primary key test' > > Note there are 2 blank lines after the GRANT ALL ON TABLE line, and > none before the COMMENT ON CONSTRAINT line. > > 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". > > There's also no way to view the autovacuum options I defined other > than the SQL pane. > > Fixed the spacing. > Thom > --001a1135240042ee1d05324129ae Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,


--=C2=A0
Harshal Dhumal
Softwar= e Engineer=C2=A0




On Wed, Apr 27, 2016 at 6:13 PM, Thom Brown = <t= hom@linux.com> wrote:
On 27= April 2016 at 10:22, Harshal Dhumal
<har= shal.dhumal@enterprisedb.com> wrote:
>
> Hi,
>
> PFA attached patches for table node and all table child nodes.
>
> This patch includes below nodes,
>
> 1) Table node=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 =C2=A0 -- Initial patch by Murtuz= a, constraints compatibility by Harshal.
> 2) Column node=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-- by Murtuza.
> 3) Index node=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 =C2=A0 -- by Murtuza.
> 4) Trigger node=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 -- by Murtuzz.
> 6) Rules node=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 =C2=A0 -- by Surinder.
> 7) Constraints nodes:
>=C2=A0 =C2=A0 =C2=A0 =C2=A0i]=C2=A0 Index Constraint=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0-- Initial patch by Harshal, I= ntegration with table node by Murtuza.
>=C2=A0 =C2=A0 =C2=A0 =C2=A0ii] Foreign key=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 -- Initial patch an= d Integration with table node by Harshal.
>=C2=A0 =C2=A0 =C2=A0 =C2=A0iii] Check constraint=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 -- Initial patch and Integration with ta= ble node by Harshal.
>=C2=A0 =C2=A0 =C2=A0 =C2=A0iv] Exclusion constraint=C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0-- Initial patch and Integration with table node by Ha= rshal.
>
> Please apply patches in following order as all of them depends on each= other.
>
> Order:=C2=A0 Table Node ----> Index constraint ---> remaining pa= tches in any order.
>
>

Nice work.=C2=A0 Here's some initial feedback from a very quick = play around.

On the Create table editor, in the Advance tab (which should probably
be labelled "Advanced"), the Like section should grey out the &qu= ot;With *"
values if no relation is selected in the drop-down box.

Fixed
=C2=A0
The way primary keys are defined are kinda awkward.=C2=A0 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.=C2=A0 If they want to refine it, they could edit it in the Constraints > Primary Key section.

I have added functionality. However check box = will only be enabled in expanded mode of column (by clicking on edit button= which at left side of delete button). To enable check box in grid mode this patch needs to be commit= ted.
=C2=A0

I'm getting weird spacing in the SQL output.=C2=A0 Here's an exampl= e:

CREATE UNLOGGED TABLE public.test
(
=C2=A0 =C2=A0 id integer COLLATE pg_catalog."de_DE.utf8" NOT NULL= DEFAULT -1,
=C2=A0 =C2=A0 stuff text COLLATE pg_catalog."C.UTF-8" DEFAULT &qu= ot;hello",
=C2=A0 =C2=A0 CONSTRAINT pk PRIMARY KEY (id, stuff) WITH (FILLFACTOR=3D33) = DEFERRABLE
)
WITH (
=C2=A0 =C2=A0 OIDS =3D TRUE,
=C2=A0 =C2=A0 FILLFACTOR =3D 88,
=C2=A0 =C2=A0 autovacuum_enabled =3D TRUE,
=C2=A0 =C2=A0 autovacuum_analyze_scale_factor =3D 0.33,
=C2=A0 =C2=A0 autovacuum_analyze_threshold =3D 30,
=C2=A0 =C2=A0 autovacuum_freeze_max_age =3D 3333333,
=C2=A0 =C2=A0 autovacuum_vacuum_cost_delay =3D 30,
=C2=A0 =C2=A0 autovacuum_vacuum_cost_limit =3D 3,
=C2=A0 =C2=A0 autovacuum_vacuum_scale_factor =3D 0.33,
=C2=A0 =C2=A0 autovacuum_vacuum_threshold =3D 33,
=C2=A0 =C2=A0 autovacuum_freeze_min_age =3D 3300000,
=C2=A0 =C2=A0 autovacuum_freeze_table_age =3D 333000000
)
TABLESPACE pg_default;

ALTER TABLE public.test
=C2=A0 =C2=A0 OWNER to thom;
GRANT ALL ON TABLE public.test TO thom;


COMMENT ON TABLE public.test
=C2=A0 =C2=A0 IS 'This is just a test table';

COMMENT ON COLUMN public.test.id
=C2=A0 =C2=A0 IS 'the main ID';

ALTER TABLE public.test
=C2=A0 =C2=A0 ALTER COLUMN id
=C2=A0 =C2=A0 SET (n_distinct=3D'0.2');
COMMENT ON CONSTRAINT pk ON public.test
=C2=A0 =C2=A0 IS 'primary key test'

Note there are 2 blank lines after the GRANT ALL ON TABLE line, and
none before the COMMENT ON CONSTRAINT line.

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<= br> string literal, so it's looking for a column called "hello".<= br>
There's also no way to view the autovacuum options I defined other
than the SQL pane.


Fixed the spacing.
=C2=A0
Thom

--001a1135240042ee1d05324129ae--