Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aqKEF-0006CK-EO for pgadmin-hackers@arkaria.postgresql.org; Wed, 13 Apr 2016 12:49:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1aqKEF-000409-1D for pgadmin-hackers@arkaria.postgresql.org; Wed, 13 Apr 2016 12:49:07 +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 1aqKE1-0003le-LE for pgadmin-hackers@postgresql.org; Wed, 13 Apr 2016 12:48:53 +0000 Received: from mail-ig0-x22d.google.com ([2607:f8b0:4001:c05::22d]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1aqKDx-0006mQ-Jb for pgadmin-hackers@postgresql.org; Wed, 13 Apr 2016 12:48:53 +0000 Received: by mail-ig0-x22d.google.com with SMTP id ui10so55943474igc.1 for ; Wed, 13 Apr 2016 05:48:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pgadmin-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=6LK5QOlFcfvA9aT1PLnjk9td1bI3AwICYmyC4pFWpeQ=; b=b+IH2+Psa9v0YoKH5yk93ZeWDcA65H5J2Ad3V7bQz1IyzyxVxeapP+IRF8aHqt+Wds 1TjLgyAK1eOoSyERLGWVECoABHKUgxGj6X8eky92rPhv/y21UZUecUStDfaAyI2UgJ0D EWCVjHQwV/DLR3lAOx6d15/zktt7WfgF57I7j0IRDYRaEPskO7ICG/9vB3CIf2FofPwa QpKCTM6BoXRua0Ze/FPXJrLgi/TMDS0nh07ok5yYJNeHRK8/2o/ecQfGE+FXA1eku2BK PbfFOxdlVdM9ZtbF+f/+g4Wc9LdbX8xXXG0vsFdygB7tBvHvCUVEguCUBtynxvqcnDmC D+bQ== 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=6LK5QOlFcfvA9aT1PLnjk9td1bI3AwICYmyC4pFWpeQ=; b=WqOUrt/4UOJluPLZlYf0IuRqcCbQVgAZd+jWk0AEbeWklnXeixsmpQhWJzQrv6+mzB zabN2tMYe9SsbfXooGf12eJdJVi4xt8NSzwix6MW6DS2eFm5XNUcPhO7nCNx5KVDEpVf /X4Flsi9Nq4mPlKQoiB4xDyjnl3xVd10nAUs3lrKFAHmpC93eJR5YAXGKq3VDHpZbee0 Q1AzUgFDpJJ7zQqvMdMbUqysPkmbpizIRnBEowRFDSoRt2RX7oThUHMIGXsAz65iTOt8 vbQKmupeqh/PbaPweKhykwh6ycHW5u0vyQnJYd2x+ioAat++rAbHy0vTIQ47rTcqkiAA MuKQ== X-Gm-Message-State: AD7BkJKwdB83XyI4FwPWYl7blI9ku3qMxmSlsvAyc+jHEFCQtW++09ypp0wM4xm9Bx8uTp9aiMPeOkHL0qhh2g== MIME-Version: 1.0 X-Received: by 10.50.66.171 with SMTP id g11mr30515777igt.96.1460551727050; Wed, 13 Apr 2016 05:48:47 -0700 (PDT) Received: by 10.64.105.131 with HTTP; Wed, 13 Apr 2016 05:48:46 -0700 (PDT) In-Reply-To: References: Date: Wed, 13 Apr 2016 13:48:46 +0100 Message-ID: Subject: Re: PATCH: Added Node Type & Catalog objects [pgAdmin4] From: Dave Page To: Murtuza Zabuawala Cc: pgadmin-hackers Content-Type: text/plain; charset=UTF-8 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 I'm seeing some more issues now, some related to new functionality: - Please don't include the descriptive header for shell types in create.sql. - Shell types can (and should) have owner/comments set if specified. - The Type dropdown should just say "Shell" for shell types (no additional text). - Privileges and labels grids should be disabled for shell types. - When I select External type, I see the following error (and a 500 error in the browser console): 2016-04-13 13:44:49,953: ERROR pgadmin: Failed to execute query (execute_2darray) for the server #1 - DB:pem (Query-id: 4020898): Error Message:ERROR: syntax error at or near "and" LINE 2: CASE WHEN length(nspname) > 0 AND and length(nspname) !=... - Length/Precision and scale are not shown in the dialogue for existing types. Thanks. On Fri, Apr 8, 2016 at 2:52 PM, Murtuza Zabuawala wrote: > Hi Dave, > > Please find updated patches to fix all the mentioned issues. > > There are three patches, > 1) One for fixing rendering issue when selecting type > 2) Added utility function to fetch full type name with length & precision > 3) Added new Shell type for External types. > > > Regards, > Murtuza > > > -- > Regards, > Murtuza Zabuawala > EnterpriseDB: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > > On Thu, Apr 7, 2016 at 5:06 PM, Dave Page wrote: >> >> Hi Murtuza >> >> On Tue, Mar 22, 2016 at 9:22 AM, Dave Page wrote: >> > Hi >> > >> > On Tue, Mar 22, 2016 at 8:14 AM, Murtuza Zabuawala >> > wrote: >> >> Hi Dave, >> >> >> >> We can create new external type using below method, By running all of >> >> below >> >> queries at the same time , we can not create separate external type by >> >> only >> >> using create type statement. >> >> >> >> So as per my discussion with Ashesh, We should not allow user to create >> >> external type in pgAdmin4 but only show definition in edit mode. >> > >> > Hmm, would it not make sense to allow the user to create the shell >> > type as well (perhaps, with a new type of "SHELL")? Then they could do >> > what is needed (and that should be easy, as it's just CREATE TYPE >> > foo;) >> > >> > For example: >> > >> > CREATE TYPE box; >> > >> > CREATE FUNCTION my_box_in_function(cstring) RETURNS box AS ... ; >> > CREATE FUNCTION my_box_out_function(box) RETURNS cstring AS ... ; >> > >> > CREATE TYPE box ( >> > INTERNALLENGTH = 16, >> > INPUT = my_box_in_function, >> > OUTPUT = my_box_out_function >> > ); >> > >> > CREATE TABLE myboxes ( >> > id integer, >> > description box >> > ); >> >> In the interests of making progress, I've committed the most recent >> patch, with a number of minor changes most significantly, the Postgres >> docs and system catalogs seem to have different ideas about what to >> call length, precision and scale. pgAdmin 3 followed the catalogs and >> used length and precision, however I've updated pgAdmin 4 to use >> "Length/precision" and "Scale" which is inline with the Postgres docs. >> That's only in the UI though - the code follows the catalogs. >> >> There are still a couple of issues - please provide fixes ASAP: >> >> 1) If you create a composite type that contains a sized type (e.g. >> numeric(5, 4), the precision and scale are not shown if you later open >> the properties dialogue, or in the reverse engineered SQL. >> >> E.g. what pgAdmin3 shows as: >> >> CREATE TYPE pem.blergh AS >> (c1 text COLLATE pg_catalog."C", >> c2 numeric(5)); >> >> Is shown by pgAdmin4 as: >> >> CREATE TYPE pem.blergh AS >> (c1 text COLLATE pg_catalog."C", c2 numeric); >> >> (adding the \n's would be good too). >> >> 2) If you select a different type of type in create mode, the new >> options are shown below those for the previously selected type, >> instead of replacing them. Please see the attached screenshot. >> >> 3) I would still like us to support External types. I believe the >> simple option here is to re-add the code you had previously, and to >> add a new type of type called "SHELL" as discussed in my previous >> email above. The user would then be able to create a SHELL type, add >> the required functions, then come back and create the EXTERNAL type. >> >> I'll add cards to our internal kanban chart for these issues. >> >> Thanks. >> >> -- >> Dave Page >> Blog: http://pgsnake.blogspot.com >> Twitter: @pgsnake >> >> EnterpriseDB UK: http://www.enterprisedb.com >> The Enterprise PostgreSQL Company > > -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers