Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1avhYx-0008DW-Sf for pgadmin-hackers@arkaria.postgresql.org; Thu, 28 Apr 2016 08:44:44 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1avhYx-0004GH-En for pgadmin-hackers@arkaria.postgresql.org; Thu, 28 Apr 2016 08:44:43 +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 1avhYw-0004G1-Jk for pgadmin-hackers@postgresql.org; Thu, 28 Apr 2016 08:44:42 +0000 Received: from mail-vk0-x244.google.com ([2607:f8b0:400c:c05::244]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1avhYl-0000Yj-4y for pgadmin-hackers@postgresql.org; Thu, 28 Apr 2016 08:44:41 +0000 Received: by mail-vk0-x244.google.com with SMTP id o133so3276377vka.1 for ; Thu, 28 Apr 2016 01:44:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=zD972R+wkLlvgJ93S5msNgp01n4mHOxSbudV3TbXhvk=; b=kgqwhBWzKaRUr1/Gx8YutR0mG3HFYeL7I/DMpTNdYwQW/FjNgCc73Os4yCwQ+w5lu+ QPRY7uNJapYae86lCKf7tMQkVqJomahswR6DQSPExFQ2WIh/300QdIlGJ4Yq7o/blx50 jukCDR4iTUxqFH+zGYxWsHyZzj9ZTlYRblzr8POSAmhjna5EfC5vbkH99w2OJMVvFSia HNkmF00DJcfdG7KIjyahvDkLLfLWbqm5kGOllvyf2tTTLZzr5VQoIxZGV1hRYHENOxEX 8SZjlodFAhpqCEUVPKAOEnDUDvjdXm6FgBAHDatJ+qwK2mz/kMKRYSBK1PcpvqYrYcnP sttA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=zD972R+wkLlvgJ93S5msNgp01n4mHOxSbudV3TbXhvk=; b=f9P60i9Q++bvG8a8UOHzZ3Yj8eCySrmJ0CkCEGjimTb+NLX1picJF+h3bfz1/TqM60 fKUauGwkZlWG0m1ZCjdn9Nfgvx7fdvdYlpmQWVn36lblczZDhMoqpqjUZ+b8k3cI3s6K ETp2BlprJwHd5pX0eXRxBjcclEQwYQPGnmAa6X4lAKoWTYYgnFokjRVY42P9iFIfVgje GGNUlzs5kWz1kQjra1zWVWkvHZO9Uy9PghXYKy8Hr2TYPLdgWXaDLmt9XJ+ra0tNpZQt jwQ6UACf9PNIpj7egRVMmt7cOj50WTlSWXK5mZCDco+Juwt3SophGpBMcDlVoO9bPvlh lvNA== X-Gm-Message-State: AOPr4FVFA97M688T+XUGL7GW8fN+jgBG+oyusck3NSKknXy9F7oIsG7jxIZPTVgjGvYduakEukEn1EQXKkAcdA== X-Received: by 10.31.168.9 with SMTP id r9mr1695536vke.65.1461833069900; Thu, 28 Apr 2016 01:44:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.159.54.239 with HTTP; Thu, 28 Apr 2016 01:44:00 -0700 (PDT) In-Reply-To: References: From: Thom Brown Date: Thu, 28 Apr 2016 09:44:00 +0100 X-Google-Sender-Auth: gbR-252tTEHgAJBpmFnqRNiomCw Message-ID: Subject: Re: [PATCH] Tables node (pgAdmin4) To: Harshal Dhumal Cc: pgadmin-hackers , Murtuza Zabuawala , Surinder Kumar Content-Type: text/plain; charset=UTF-8 X-Pg-Spam-Score: -2.4 (--) 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 On 27 April 2016 at 14:34, Thom Brown wrote: > On 27 April 2016 at 13:43, 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. >> >> 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'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. > > A couple more: > > 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: > > ERROR: syntax error at or near "INHERITS" > LINE 2: INHERITS (test) > ^ > > This is because no column list was provided, and in this case, an > empty one would be needed. So instead of: > > CREATE TABLE public.test2 > ( > ) > INHERITS (test) > WITH ( > OIDS = FALSE > ) > TABLESPACE pg_default; > > It should be: > > CREATE TABLE public.test2 > INHERITS (test) > WITH ( > OIDS = FALSE > ) > TABLESPACE pg_default; Correction, these should be the other way around. Thom -- Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers