Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5tIr-0007tj-PX for pgadmin-hackers@arkaria.postgresql.org; Thu, 26 May 2016 11:18:13 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1b5tIr-0006U9-CZ for pgadmin-hackers@arkaria.postgresql.org; Thu, 26 May 2016 11:18:13 +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 1b5sd3-0003F4-Nm for pgadmin-hackers@postgresql.org; Thu, 26 May 2016 10:35:01 +0000 Received: from mail-vk0-x233.google.com ([2607:f8b0:400c:c05::233]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1b5scz-0001xV-Gj for pgadmin-hackers@postgresql.org; Thu, 26 May 2016 10:35:01 +0000 Received: by mail-vk0-x233.google.com with SMTP id k1so41385633vka.3 for ; Thu, 26 May 2016 03:34:57 -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=qRZHudW+g3U5P9vsQwmvZGi+uXZ6SL8sOe5wCvTUcgw=; b=W5TQIsxjKCM//PRmdtpo45L9K3Pw86aWk7QMcfbzKWlWIneuL0BOxtAxJq2hDJt4O9 /GVUu/QftEIneb1EVLtEY2i2wtSBXYM7F4f0Q5zw3KWqGC1K9oVudLGyC7+lzgOk3wSN dAtcRgmwo2Kly79A3PrvQW9HeYu+ul7TbzBPEWaarVpEII3O6mKFkeZi2nMAiMQPi/he QxFTZt4hBXC96o1VCdo8GQKU3W6+r9ApMpGuSGv0p/VhyQneIAjUfc/VlDRtaSwG6Qm0 mkQudNBdo2lrejp8+GJ23CMVVMfpxBO6BDk7kGkQXZDM9EUBSxMnAbJl4b0uY1CPJP8W n+hg== 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=qRZHudW+g3U5P9vsQwmvZGi+uXZ6SL8sOe5wCvTUcgw=; b=HgTXgA1SZG4dT3voSHG7JOMKxDQMWPZPNk9caD8UqNl4zBjTIhG5Rr4yJQofHDAtdd zEgLAt+6TPkhWRrMnR++j/K2wf+WXn0usaMLSzcmF9QKWUnKyf7eHg5Npfz0C0KJ/HY6 p7wPvhmd35EP+POQGhSvyVifEXK+UmzQuY32ZJM4hrxvRhDrrTrxGJQvZHu7uua9wUbh epEWv1PGZxg3GFh13IUGEBzraziywkPKuZ49IxIvM4mIOvQVTY4l6GyEp+gasXOBZ4dv HAg3oimgF+SQLoY3yLM1XvanC+2YZrvGl7XTbf36ONAtlpC0ynXy9rmov5QLMfzZ0tI7 20iw== X-Gm-Message-State: ALyK8tIVXTfGtbgX5dZQa2OiQVSd7u9fzuT4goTyS6CX6S5/cItABxGBSkDDuXJGruQeRZLkgAIQBv+d75NNvQ== X-Received: by 10.176.65.1 with SMTP id j1mr5270770uad.112.1464258895748; Thu, 26 May 2016 03:34:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.176.2.239 with HTTP; Thu, 26 May 2016 03:34:26 -0700 (PDT) In-Reply-To: References: From: Thom Brown Date: Thu, 26 May 2016 11:34:26 +0100 X-Google-Sender-Auth: bXIrUlyNgLEuicKuFPHnY70if5g Message-ID: Subject: Re: [PATCH] Tables node (pgAdmin4) To: Murtuza Zabuawala Cc: Ashesh Vashi , pgadmin-hackers , Dave Page , Harshal Dhumal , Akshay Joshi Content-Type: multipart/alternative; boundary=94eb2c1246505724a50533bc57e9 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 --94eb2c1246505724a50533bc57e9 Content-Type: text/plain; charset=UTF-8 On 26 May 2016 at 11:20, Murtuza Zabuawala < murtuza.zabuawala@enterprisedb.com> wrote: > Hi, > > PFA patch for RM#1231 & RM#1237. > > Additionally I have shifted 'Advanced tab' after columns & constraint tab. > > > @Thom, > > Reading "Of type" drop-down, We borrowed sql query from pgadmin3 to > populate "Of type" combo box as given below. > I was not able to find a way to differentiate between table & composite > type populating from below given query, > I'll put in todo list, may be someone from community can help in future. > > SELECT t.oid, > quote_ident(n.nspname)||'.'||quote_ident(t.typname) AS typname > FROM pg_type t, pg_namespace n > WHERE t.typtype='c' AND t.typnamespace=n.oid > AND NOT (n.nspname like 'pg_%' OR n.nspname='information_schema') > ORDER BY typname; > > This should work: SELECT c.oid, quote_ident(n.nspname)||'.'||quote_ident(c.relname) AS typname FROM pg_namespace n, pg_class c WHERE c.relkind = 'c' AND c.relnamespace=n.oid AND NOT (n.nspname like 'pg_%' OR n.nspname='information_schema') ORDER BY typname; Although, to avoid confusion, the "typname" alias should probably just be "relname". Thom --94eb2c1246505724a50533bc57e9 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On 2= 6 May 2016 at 11:20, Murtuza Zabuawala <murtuza.zabuawala= @enterprisedb.com> wrote:
Hi,

PFA patch for RM#1231 & RM#1237.
<= div>
Additionally I have shifted 'Advanced tab' after= columns & constraint tab.


@Tho= m,

Reading "Of type" drop-down, We borro= wed sql query from pgadmin3 to populate "Of type" combo box as gi= ven below.
I was not able to find a way to differentiate between = table & composite type populating from below given query, =C2=A0
<= div>I'll put in todo list, may be someone from community can help in fu= ture.=C2=A0

SELECT t.= oid,
=C2=A0 quote_ident(n.nspname)= ||'.'||quote_ident(t.typname) AS typname
=C2=A0 FROM pg_type t, pg_namespace n
WHERE t.typtype=3D'c' AND t.typnamespace=3Dn.oid=
=C2=A0 AND NOT (n.nspname like &#= 39;pg_%' OR n.nspname=3D'information_schema')
= ORDER BY typname;


This should work:

SELECT c.oid,=C2=A0 quote_ident(n.nspname)||'.'||quote_ident(c.relname) AS typn= ame
=C2=A0 FROM pg_namespace n, pg_class c
WHERE c.relkind =3D 'c= ' AND c.relnamespace=3Dn.oid
=C2=A0 AND NOT (n.nspname like &= #39;pg_%' OR n.nspname=3D'information_schema')
ORDER BY typn= ame;

Although, to avoid confusion, the "typname"= ; alias should probably just be "relname".
=C2=A0
Thom
--94eb2c1246505724a50533bc57e9--