public inbox for [email protected]
help / color / mirror / Atom feedFrom: Dave Page <[email protected]>
To: Khushboo Vashi <[email protected]>
Cc: pgadmin-hackers <[email protected]>
Subject: Re: pgAdmin4 PATCH: Domain Module
Date: Thu, 25 Feb 2016 13:30:56 +0000
Message-ID: <CA+OCxoxkows1UUgaddq3+R2VcTW9Vmc3QCKdrtd1sNP+fDsHTg@mail.gmail.com> (raw)
In-Reply-To: <CA+OCxozpzStRAm=rm3s2ZdtehMt6WfQTVEFT3fssorNc5M2UHQ@mail.gmail.com>
References: <CAFOhELf-n8mM4h8RZuqxUs-Z+f97N6Ux5KT6aoAdWFiHVVURyw@mail.gmail.com>
<CAFOhELf-QTMAgNkTT8AsRwJ38Jn_1BSFRV_G5ZmcHnrKmPsTog@mail.gmail.com>
<CACCA4P1caumXOrpEXrrETMuNGj3G3ctY-PN9=V6GUPF=dTBnWg@mail.gmail.com>
<CAFOhELdgb566u+4XXOOP4pDCF4GGzK8JZzLrrTuPt=OprsqG5Q@mail.gmail.com>
<CACCA4P06PrJ2-VodT133sheH1i+7zc_M_y_me6KfRHkLqrQ7gg@mail.gmail.com>
<CAFOhELc1OAz3BDWkKC0e0xA8sPBKiO-4vWJQ7ipMYmKC-C6YzA@mail.gmail.com>
<CACCA4P1uFijfEV6vvETXX=qjafhGZsOacdi7Og+7edaBb4erxA@mail.gmail.com>
<CAFOhELePQ_m8zmbORLmO3PUY5yTA5o_9suQKk0Tox8A7Fb8ovw@mail.gmail.com>
<CAFOhELcq3oiXAC3LVCvxVA5i8qjCh=Sk77MsVUnZB2VhwzmLKw@mail.gmail.com>
<CA+OCxozpzStRAm=rm3s2ZdtehMt6WfQTVEFT3fssorNc5M2UHQ@mail.gmail.com>
List-Unsubscribe: <mailto:[email protected]?body=unsub%20pgadmin-hackers>
Per discussion with Khushboo, the patch at
http://www.postgresql.org/message-id/attachment/41939/schemas_macros_10_Feb_2.patch
is a pre-req for this. Updated comments below...
On Thu, Feb 25, 2016 at 12:13 PM, Dave Page <[email protected]> wrote:
> Hi
>
> On Wed, Feb 24, 2016 at 9:24 AM, Khushboo Vashi <
> [email protected]> wrote:
>
>> Hi,
>>
>> I have updated the Domain module as below:
>>
>> - Used 'NodeByListControl' to get schemas, in domains.js file as
>> suggested by Ashesh to avoid code redundancy.
>>
>> - Applied *'Security Label Macro'* Patch (Implemented by Harshal) and
>> removed same changes from the Domain Patch.
>> To test Domain patch, 'Security Label Macro' patch must be applied
>> first as that is not committed yet.
>>
>> Please find attached Domain Module Patch.
>>
>
> Initial feedback:
>
> - Owner and schema should be allowed to be left blank (and then default to
> the current user/schema)
>
> - Length and Precision fields should only be enabled if appropriate for
> the data type.
>
The above still apply.
>
> - SQL generation for new Domains doesn't work:
>
This now works.
>
> - When adding constraints, I should be able to type directly into the
> grid. Expanding the row should be optional.
>
> - The comment column on the constraints grid expands when the text reaches
> ~50% of the width. It should be a fixed size (and use 100% of the space
> available, less appropriate margins).
>
> - Backend support checks should not special-case Slony schemas.
>
> - 4 character indentation not used consistently in SQL templates.
>
These still apply.
>
> - Error seen when saving a domain: "macros/schemas/security.macros"
>
> 016-02-25 11:55:10,728: INFO werkzeug: 127.0.0.1 - - [25/Feb/2016
> 11:55:10] "GET
> /browser/domain/msql/1/1/24587/2200/?name=email&owner=postgres&basensp=public&description=This+is+an+email+data+type&basetype=text&typlen=&precision=&typdefault=&typnotnull=true&collname=&constraints=%5B%5D&seclabels=%5B%5D&_=1456401124386
> HTTP/1.1" 500 -
> Traceback (most recent call last):
> File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
> line 1836, in __call__
> return self.wsgi_app(environ, start_response)
> File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
> line 1820, in wsgi_app
> response = self.make_response(self.handle_exception(e))
> File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
> line 1403, in handle_exception
> reraise(exc_type, exc_value, tb)
> File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
> line 1817, in wsgi_app
> response = self.full_dispatch_request()
> File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
> line 1477, in full_dispatch_request
> rv = self.handle_user_exception(e)
> File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
> line 1381, in handle_user_exception
> reraise(exc_type, exc_value, tb)
> File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
> line 1475, in full_dispatch_request
> rv = self.dispatch_request()
> File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
> line 1461, in dispatch_request
> return self.view_functions[rule.endpoint](**req.view_args)
> File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/views.py",
> line 84, in view
> return self.dispatch_request(*args, **kwargs)
> File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/utils.py", line 248,
> in dispatch_request
> return method(*args, **kwargs)
> File
> "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/__init__.py",
> line 277, in wrap
> return f(*args, **kwargs)
> File
> "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/__init__.py",
> line 232, in wrap
> return f(self, **kwargs)
> File
> "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/__init__.py",
> line 700, in msql
> status=200
> File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/ajax.py", line 41, in
> make_json_response
> response=json.dumps(doc, cls=DataTypeJSONEncoder),
> File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/simplejson/__init__.py",
> line 386, in dumps
> **kw).encode(obj)
> File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/simplejson/encoder.py",
> line 269, in encode
> chunks = self.iterencode(o, _one_shot=True)
> File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/simplejson/encoder.py",
> line 348, in iterencode
> return _iterencode(o, 0)
> File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/ajax.py", line 26, in
> default
> return json.JSONEncoder.default(self, obj)
> File
> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/simplejson/encoder.py",
> line 246, in default
> raise TypeError(repr(o) + " is not JSON serializable")
> TypeError: TemplateNotFound() is not JSON serializable
>
This issue is resolved.
Additional issues:
- We can add a comment to constraints (and view them), however they are not
saved.
- The domain is not created as a single SQL statement, but by creating a
domain over the base type, then adding constraints. Can this be done in one
query?
- Reverse engineered SQL doesn't include the normal header and
commented-out drop statement.
Thanks.
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
view thread (29+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: pgAdmin4 PATCH: Domain Module
In-Reply-To: <CA+OCxoxkows1UUgaddq3+R2VcTW9Vmc3QCKdrtd1sNP+fDsHTg@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox