Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d8NB1-0007N2-8N for pgadmin-hackers@arkaria.postgresql.org; Wed, 10 May 2017 08:40:55 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d8NB0-00019i-Qv for pgadmin-hackers@arkaria.postgresql.org; Wed, 10 May 2017 08:40:54 +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 1d8NAi-000070-KR for pgadmin-hackers@postgresql.org; Wed, 10 May 2017 08:40:37 +0000 Received: from mail-wr0-x22f.google.com ([2a00:1450:400c:c0c::22f]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1d8NAe-0001MP-9g for pgadmin-hackers@postgresql.org; Wed, 10 May 2017 08:40:35 +0000 Received: by mail-wr0-x22f.google.com with SMTP id w50so33544894wrc.0 for ; Wed, 10 May 2017 01:40:32 -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:from:date:message-id:subject:to :cc; bh=jpyj13qPhJBLXWx0ZKRPNlXafgVeQKJW+NQSnMSVX3o=; b=YdqDAnQSaiV32HzhWxFV8DMz7N+bWS4CLiMboYIFIca+T2iIDDElQD7NfOFA5Ks/eX dSlM28zlP1zBRs5Tn8rOgBx5RA/TsmzGjzT/CtAgh4ioRpc/+bFNAoQAR1Coq+IciIWl M2j6pHr9IaRARyDMglsodeqCoxKKkGkDXmRh5552xAP79zA3bL67AZlyYV3K1P1+K72z fC46cp/N2VV2FYRW/aA6UFn9eqjbllZbxrK1NfOlMnvDRZXHjPPfF321Z/z9fQ1Jiahj VMolIlAytWRC1G2gRyDokNstI5ghQpFk5GmJ3ub6f6U/NyLPUa3nKszaDoYc9j6AKBfc sIvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=jpyj13qPhJBLXWx0ZKRPNlXafgVeQKJW+NQSnMSVX3o=; b=WnAd8sp9hqK9M9TzVJ3gG5vXZIdMcUtkBIFdqQqcjYjnBYLU14+VefgRXAPSpOoKsf 6Sr2NwzNoySDI9EDvhVOejVWfHfNFgMuBV8L0Gh7xGfM72y79We5f3Fp/Uqu7BTPclDu FbwBqlnFqt8fy/wYUFwddkXBnIndgPBCjE8bOl+OErXW0RyRiqlmtpxAlv7bTEQF65Ch Lo3M/cyILPvRq7H2LSID+RcqVboG268d47e2yDFYM4NzInQOQfksnpNqSlstGz+GyAsF mT4mIT3+JtQ5VE7RDHEudMmg5/wwSy8rPmAdSw/tQHD3WlkjdVyanNHzir6rW7/w2/GV 5JZQ== X-Gm-Message-State: AODbwcAC1/gpgA6x1Z8AuLkeXev+YFnofmSD2tWRj7ogPVI5ovBtPX5X /I/lQjVcXZDCwWvtAYbihVlOY3imx6Oa X-Received: by 10.223.136.235 with SMTP id g40mr3084980wrg.107.1494405630776; Wed, 10 May 2017 01:40:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.19.138 with HTTP; Wed, 10 May 2017 01:39:59 -0700 (PDT) In-Reply-To: References: From: Surinder Kumar Date: Wed, 10 May 2017 14:09:59 +0530 Message-ID: Subject: Re: [pgAdmin4][Patch][RM2257]: Query tool - Insert row doesn't use default values To: Dave Page Cc: pgadmin-hackers Content-Type: multipart/alternative; boundary=001a11498cd4c5ea47054f276c1c X-Pg-Spam-Score: -1.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 --001a11498cd4c5ea47054f276c1c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Dave, On Wed, May 10, 2017 at 2:06 PM, Dave Page wrote: > Any chance we can get this wrapped up today Surinder? > =E2=80=8BI have fixed RM case, I am currently writing its feature test case= s which is taking some time. Should I send patch for RM case only?=E2=80=8B I will try to complete test = cases by today eod. > > On Tue, May 9, 2017 at 11:29 AM, Dave Page wrote: > >> >> >> On Tue, May 9, 2017 at 11:03 AM, Surinder Kumar < >> surinder.kumar@enterprisedb.com> wrote: >> >>> Hi Dave, >>> >>> On Mon, May 8, 2017 at 4:37 PM, Dave Page wrote: >>> >>>> >>>> >>>> On Mon, May 8, 2017 at 11:51 AM, Surinder Kumar < >>>> surinder.kumar@enterprisedb.com> wrote: >>>> >>>>> Hi >>>>> >>>>> On Mon, May 8, 2017 at 3:51 PM, Dave Page wrote: >>>>> >>>>>> Hi >>>>>> >>>>>> On Mon, May 8, 2017 at 11:13 AM, Surinder Kumar < >>>>>> surinder.kumar@enterprisedb.com> wrote: >>>>>> >>>>>>> Hi Dave, >>>>>>> >>>>>>> On Mon, May 8, 2017 at 3:28 PM, Dave Page wrote= : >>>>>>> >>>>>>>> Hi >>>>>>>> >>>>>>>> On Fri, May 5, 2017 at 12:52 PM, Surinder Kumar < >>>>>>>> surinder.kumar@enterprisedb.com> wrote: >>>>>>>> >>>>>>>>> Hi Dave, >>>>>>>>> >>>>>>>>> The support to handle [null] and [default] values is added for >>>>>>>>> following formatters: >>>>>>>>> - JsonFormatter >>>>>>>>> - NumbersFormatter >>>>>>>>> - CheckmarkFormatter >>>>>>>>> - TextFormatter >>>>>>>>> >>>>>>>>> Previously when a new row is added, it was not validating each an= d >>>>>>>>> every cell for columns with attribute not_null =3D true. >>>>>>>>> Introduced a new function validateRow(...) which is called on >>>>>>>>> adding a new row, it validates each cell with column having >>>>>>>>> attribute(not_null=3Dtrue). the corresponding cell will highlight= ed and save >>>>>>>>> button will be disabled if value is [null]. >>>>>>>>> >>>>>>>> >>>>>>>> I'm not sure that behaviour is right. What I now see (given the >>>>>>>> table below) is that: >>>>>>>> >>>>>>>> - If I click in the id field of a new row, it forces me to enter a >>>>>>>> value or hit escape. Why is it trying to force me? It's a serial f= ield, so >>>>>>>> will get a value on save anyway. >>>>>>>> >>>>>>> =E2=80=8BYes, It is because I am validating all cell values after i= t >>>>>>> renders. It will reverted back. >>>>>>> >>>>>>>> >>>>>>>> - If I do enter a value in the ID field, focus jumps over all the >>>>>>>> other fields with either a default or no 'not null' option to the >>>>>>>> data_no_nulls column. Focus should always go to the next field. >>>>>>>> >>>>>>>> I think this addition can just be removed - I'm pretty sure the >>>>>>>> previous behaviour would have been what we want, with the addition= al >>>>>>>> formatters fixed. >>>>>>>> >>>>>>> =E2=80=8BBut If i remove this addition, the value for column like >>>>>>> 'data_no_nulls' =E2=80=8Bwill be set to '' (blank string), then on = save its value >>>>>>> will be validated on the server side and whatever the error message= is will >>>>>>> be returned back (the same behaviour as in pgAdmin3) >>>>>>> >>>>>> >>>>>> Which is fine I think. If you want to leave the validation there, >>>>>> that's also fine - but, it a) shouldn't require me to press Esc if I= decide >>>>>> not to fill in that value yet, and b) shouldn't change the tab order= of the >>>>>> fields. It's also broken of course, in that it was trying to force m= e to >>>>>> enter a value for a not-null field with a default. >>>>>> >>>>> =E2=80=8BYes, I will check if we just highlight the field and don't f= orce the >>>>> user to =E2=80=8Benter value. >>>>> This will enable user to edit any field using TAB key even if require= d >>>>> field is highlighted red. >>>>> Should the save button remains disable untill user enters any valid >>>>> value in 'data_no_nulls' column ? >>>>> >>>> >>>> I think that's fine, yes - as long as we get the validation right :-) >>>> >>> =E2=80=8BFor highlighting the error field and enable user to navigate t= o other >>> cells using TAB key, >>> I spend some time looking and debugging into the code and found that it >>> requires lot of changes in slick.grid.js core functions as there are no >>> event listeners provided to =E2=80=8Blisten and changes in core file is= not >>> preferred. It may also break other functionalities as code is quite com= plex. >>> So, I think we should validate data on server side and display any erro= r >>> messages on UI. >>> >> >> OK. >> >> >>> >>>>>> >>>>> >>>>>>>> >>>>>>>>> >>>>>>>>> Now I will add more feature test cases for remaining formatters. >>>>>>>>> Will send separate patch for feature test cases once completed. >>>>>>>>> >>>>>>>> >>>>>>>> Thanks. >>>>>>>> >>>>>>>> >>>>>>>>> >>>>>>>>> Please review updated patch. >>>>>>>>> >>>>>>>>> >>>>>>>>> On Tue, May 2, 2017 at 5:57 PM, Surinder Kumar < >>>>>>>>> surinder.kumar@enterprisedb.com> wrote: >>>>>>>>> >>>>>>>>>> Hi Dave, >>>>>>>>>> >>>>>>>>>> On Tue, May 2, 2017 at 5:21 PM, Dave Page >>>>>>>>>> wrote: >>>>>>>>>> >>>>>>>>>>> Hi, >>>>>>>>>>> >>>>>>>>>>> This is looking much better now :-). Couple of thoughts and a >>>>>>>>>>> bug: >>>>>>>>>>> >>>>>>>>>>> - Only the TextFormatter seems to handle both [null] and >>>>>>>>>>> [default] values. Shouldn't all formatters do so (including Jso= n and >>>>>>>>>>> Checkmark)? >>>>>>>>>>> >>>>>>>>>> =E2=80=8BYes, I will apply the same changes for other formatters= too.=E2=80=8B >>>>>>>>>> >>>>>>>>>>> For example, "serial" columns currently get displayed as [null] >>>>>>>>>>> when left blank, but I would expect to see [default]. >>>>>>>>>>> >>>>>>>>>>> - I would suggest we put [null] and [default] in a lighter >>>>>>>>>>> colour - #999999. >>>>>>>>>>> >>>>>>>>>>> - With the feature test patch added, I seem to be consistently >>>>>>>>>>> getting the following failure (immediately after your new tests= run): >>>>>>>>>>> >>>>>>>>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>>>>>>>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>>>>>>>>>> ERROR: runTest (pgadmin.feature_tests.xss_che >>>>>>>>>>> cks_panels_and_query_tool_test.CheckForXssFeatureTest) >>>>>>>>>>> Test XSS check for panels and query tool >>>>>>>>>>> ------------------------------------------------------------ >>>>>>>>>>> ---------- >>>>>>>>>>> Traceback (most recent call last): >>>>>>>>>>> File "/Users/dpage/git/pgadmin4/web >>>>>>>>>>> /regression/feature_utils/base_feature_test.py", line 42, in >>>>>>>>>>> setUp >>>>>>>>>>> self._screenshot() >>>>>>>>>>> File "/Users/dpage/git/pgadmin4/web >>>>>>>>>>> /regression/feature_utils/base_feature_test.py", line 92, in >>>>>>>>>>> _screenshot >>>>>>>>>>> python_version)) >>>>>>>>>>> File "/Users/dpage/.virtualenvs/pga >>>>>>>>>>> dmin4/lib/python2.7/site-packages/selenium/webdriver/remote/web= driver.py", >>>>>>>>>>> line 802, in get_screenshot_as_file >>>>>>>>>>> png =3D self.get_screenshot_as_png() >>>>>>>>>>> File "/Users/dpage/.virtualenvs/pga >>>>>>>>>>> dmin4/lib/python2.7/site-packages/selenium/webdriver/remote/web= driver.py", >>>>>>>>>>> line 821, in get_screenshot_as_png >>>>>>>>>>> return base64.b64decode(self.get_scre >>>>>>>>>>> enshot_as_base64().encode('ascii')) >>>>>>>>>>> File "/Users/dpage/.virtualenvs/pga >>>>>>>>>>> dmin4/lib/python2.7/site-packages/selenium/webdriver/remote/web= driver.py", >>>>>>>>>>> line 831, in get_screenshot_as_base64 >>>>>>>>>>> return self.execute(Command.SCREENSHOT)['value'] >>>>>>>>>>> File "/Users/dpage/.virtualenvs/pga >>>>>>>>>>> dmin4/lib/python2.7/site-packages/selenium/webdriver/remote/web= driver.py", >>>>>>>>>>> line 238, in execute >>>>>>>>>>> self.error_handler.check_response(response) >>>>>>>>>>> File "/Users/dpage/.virtualenvs/pga >>>>>>>>>>> dmin4/lib/python2.7/site-packages/selenium/webdriver/remote/err= orhandler.py", >>>>>>>>>>> line 193, in check_response >>>>>>>>>>> raise exception_class(message, screen, stacktrace) >>>>>>>>>>> UnexpectedAlertPresentException: Alert Text: None >>>>>>>>>>> Message: unexpected alert open: {Alert text : Are you sure you >>>>>>>>>>> wish to close the pgAdmin 4 browser?} >>>>>>>>>>> (Session info: chrome=3D58.0.3029.81) >>>>>>>>>>> (Driver info: chromedriver=3D2.29.461585 >>>>>>>>>>> (0be2cd95f834e9ee7c46bcc7cf405b483f5ae83b),platform=3DMac OS X >>>>>>>>>>> 10.12.3 x86_64) >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>>>>>>>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>>>>>>>>>> ERROR: runTest (pgadmin.feature_tests.xss_che >>>>>>>>>>> cks_pgadmin_debugger_test.CheckDebuggerForXssFeatureTest) >>>>>>>>>>> Test table DDL generation >>>>>>>>>>> ------------------------------------------------------------ >>>>>>>>>>> ---------- >>>>>>>>>>> Traceback (most recent call last): >>>>>>>>>>> File "/Users/dpage/git/pgadmin4/web >>>>>>>>>>> /regression/feature_utils/base_feature_test.py", line 42, in >>>>>>>>>>> setUp >>>>>>>>>>> self._screenshot() >>>>>>>>>>> File "/Users/dpage/git/pgadmin4/web >>>>>>>>>>> /regression/feature_utils/base_feature_test.py", line 92, in >>>>>>>>>>> _screenshot >>>>>>>>>>> python_version)) >>>>>>>>>>> File "/Users/dpage/.virtualenvs/pga >>>>>>>>>>> dmin4/lib/python2.7/site-packages/selenium/webdriver/remote/web= driver.py", >>>>>>>>>>> line 802, in get_screenshot_as_file >>>>>>>>>>> png =3D self.get_screenshot_as_png() >>>>>>>>>>> File "/Users/dpage/.virtualenvs/pga >>>>>>>>>>> dmin4/lib/python2.7/site-packages/selenium/webdriver/remote/web= driver.py", >>>>>>>>>>> line 821, in get_screenshot_as_png >>>>>>>>>>> return base64.b64decode(self.get_scre >>>>>>>>>>> enshot_as_base64().encode('ascii')) >>>>>>>>>>> File "/Users/dpage/.virtualenvs/pga >>>>>>>>>>> dmin4/lib/python2.7/site-packages/selenium/webdriver/remote/web= driver.py", >>>>>>>>>>> line 831, in get_screenshot_as_base64 >>>>>>>>>>> return self.execute(Command.SCREENSHOT)['value'] >>>>>>>>>>> File "/Users/dpage/.virtualenvs/pga >>>>>>>>>>> dmin4/lib/python2.7/site-packages/selenium/webdriver/remote/web= driver.py", >>>>>>>>>>> line 238, in execute >>>>>>>>>>> self.error_handler.check_response(response) >>>>>>>>>>> File "/Users/dpage/.virtualenvs/pga >>>>>>>>>>> dmin4/lib/python2.7/site-packages/selenium/webdriver/remote/err= orhandler.py", >>>>>>>>>>> line 193, in check_response >>>>>>>>>>> raise exception_class(message, screen, stacktrace) >>>>>>>>>>> UnexpectedAlertPresentException: Alert Text: None >>>>>>>>>>> Message: unexpected alert open: {Alert text : Are you sure you >>>>>>>>>>> wish to close the pgAdmin 4 browser?} >>>>>>>>>>> (Session info: chrome=3D58.0.3029.81) >>>>>>>>>>> (Driver info: chromedriver=3D2.29.461585 >>>>>>>>>>> (0be2cd95f834e9ee7c46bcc7cf405b483f5ae83b),platform=3DMac OS X >>>>>>>>>>> 10.12.3 x86_64) >>>>>>>>>>> >>>>>>>>>> =E2=80=8BSure. I will fix this.=E2=80=8B >>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> Thanks! >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> On Fri, Apr 28, 2017 at 10:19 AM, Surinder Kumar < >>>>>>>>>>> surinder.kumar@enterprisedb.com> wrote: >>>>>>>>>>> >>>>>>>>>>>> Hi Dave, >>>>>>>>>>>> >>>>>>>>>>>> Please find updated patch for RM case and a separate patch for >>>>>>>>>>>> Feature tests. >>>>>>>>>>>> >>>>>>>>>>>> *Python:* >>>>>>>>>>>> >>>>>>>>>>>> - Added [default] label for cells with default values while >>>>>>>>>>>> inserting a new row. >>>>>>>>>>>> >>>>>>>>>>>> - Introduced a FieldValidator function for cells that don't >>>>>>>>>>>> allow null values. If user tries to insert null value, field w= ith be >>>>>>>>>>>> highlighted with red borders around. >>>>>>>>>>>> >>>>>>>>>>>> =E2=80=8B- >>>>>>>>>>>> If a cell contains blank string('') and when we set it to null= , >>>>>>>>>>>> the change into the cell is not detected. It was because the c= omparison >>>>>>>>>>>> for (defaultValue =3D=3D null) return true if defaultValue is >>>>>>>>>>>> undefined. Hence _.isNull(value) is used to fix this. >>>>>>>>>>>> >>>>>>>>>>>> *Feature Test cases:* >>>>>>>>>>>> >>>>>>>>>>>> - Introduced a new method create_table_with_query(server, >>>>>>>>>>>> db_name, query) in test_utils.py which executes the given >>>>>>>>>>>> query on connected server. >>>>>>>>>>>> >>>>>>>>>>>> - Added a new file test_data.json that has test data for test >>>>>>>>>>>> cases. >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> On Fri, Apr 7, 2017 at 2:21 PM, Dave Page >>>>>>>>>>>> wrote: >>>>>>>>>>>> >>>>>>>>>>>>> Hi >>>>>>>>>>>>> >>>>>>>>>>>>> On Sat, Apr 1, 2017 at 12:45 PM, Surinder Kumar >>>>>>>>>>>>> wrote: >>>>>>>>>>>>> > Hi >>>>>>>>>>>>> > >>>>>>>>>>>>> > Issues fixed: >>>>>>>>>>>>> > >>>>>>>>>>>>> > 1. If a column is defined with a default modifier, there is >>>>>>>>>>>>> now way to >>>>>>>>>>>>> > insert the row with those defaults. >>>>>>>>>>>>> > The column will be left blank and it will take default valu= e >>>>>>>>>>>>> automatically. >>>>>>>>>>>>> > >>>>>>>>>>>>> > 2. If a column has a not-null constraint then an error is >>>>>>>>>>>>> returned and the >>>>>>>>>>>>> > row is not inserted. >>>>>>>>>>>>> > The column will be left blank >>>>>>>>>>>>> > >>>>>>>>>>>>> > The default values for new added rows will be displayed on >>>>>>>>>>>>> refresh/execute. >>>>>>>>>>>>> > >>>>>>>>>>>>> > Please find attached patch and review. >>>>>>>>>>>>> >>>>>>>>>>>>> This largely works as expected, but there is some weirdness. = I >>>>>>>>>>>>> have a >>>>>>>>>>>>> test table that looks like this: >>>>>>>>>>>>> >>>>>>>>>>>>> CREATE TABLE public.defaults >>>>>>>>>>>>> ( >>>>>>>>>>>>> id bigint NOT NULL DEFAULT nextval('defaults_id_seq'::reg >>>>>>>>>>>>> class), >>>>>>>>>>>>> data_default_nulls text COLLATE pg_catalog."default" >>>>>>>>>>>>> DEFAULT 'abc123'::text, >>>>>>>>>>>>> data_default_no_nulls text COLLATE pg_catalog."default" >>>>>>>>>>>>> NOT NULL >>>>>>>>>>>>> DEFAULT 'def456'::text, >>>>>>>>>>>>> data_nulls text COLLATE pg_catalog."default", >>>>>>>>>>>>> data_no_nulls text COLLATE pg_catalog."default" NOT NULL, >>>>>>>>>>>>> CONSTRAINT defaults_pkey PRIMARY KEY (id) >>>>>>>>>>>>> ) >>>>>>>>>>>>> >>>>>>>>>>>>> Remember that the expected behaviour is: >>>>>>>>>>>>> >>>>>>>>>>>>> - Set a value to empty to update the column to null. >>>>>>>>>>>>> - Set a value to '' to update the column to an empty string >>>>>>>>>>>>> - Set a value to anything else to update the column to that >>>>>>>>>>>>> value >>>>>>>>>>>>> >>>>>>>>>>>>> 1) In a row with values in each column, if I try to set the >>>>>>>>>>>>> value of >>>>>>>>>>>>> data_default_nulls to null, the query executed is: >>>>>>>>>>>>> >>>>>>>>>>>>> UPDATE public.defaults SET >>>>>>>>>>>>> data_default_nulls =3D '' WHERE >>>>>>>>>>>>> id =3D '2'; >>>>>>>>>>>>> >>>>>>>>>>>>> 2) If I do the same in the data_nulls column, the value is >>>>>>>>>>>>> immediately >>>>>>>>>>>>> shown as [null] and the query executed is: >>>>>>>>>>>>> >>>>>>>>>>>>> UPDATE public.defaults SET >>>>>>>>>>>>> data_nulls =3D NULL WHERE >>>>>>>>>>>>> id =3D '2'; >>>>>>>>>>>>> >>>>>>>>>>>>> 3) If I then edit the value in data_default_nulls, it shows t= he >>>>>>>>>>>>> current value as ''. Removing the quotes (to set it to null) >>>>>>>>>>>>> doesn't >>>>>>>>>>>>> get detected as a change. >>>>>>>>>>>>> >>>>>>>>>>>> =E2=80=8B=E2=80=8BTaken care. >>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> 4) When I manually executed "update defaults set >>>>>>>>>>>>> data_default_nulls =3D >>>>>>>>>>>>> null where id =3D 2" in a query tool window, I got: >>>>>>>>>>>>> >>>>>>>>>>>>> 2017-04-07 09:43:02,987: INFO werkzeug: 127.0.0.1 - - >>>>>>>>>>>>> [07/Apr/2017 >>>>>>>>>>>>> 09:43:02] "GET /sqleditor/columns/8745675 HTTP/1.1" 500 - >>>>>>>>>>>>> Traceback (most recent call last): >>>>>>>>>>>>> File "/Users/dpage/.virtualenvs/pga >>>>>>>>>>>>> dmin4/lib/python2.7/site-packages/flask/app.py", >>>>>>>>>>>>> line 2000, in __call__ >>>>>>>>>>>>> return self.wsgi_app(environ, start_response) >>>>>>>>>>>>> File "/Users/dpage/.virtualenvs/pga >>>>>>>>>>>>> dmin4/lib/python2.7/site-packages/flask/app.py", >>>>>>>>>>>>> line 1991, in wsgi_app >>>>>>>>>>>>> response =3D self.make_response(self.handle_exception(e)) >>>>>>>>>>>>> File "/Users/dpage/.virtualenvs/pga >>>>>>>>>>>>> dmin4/lib/python2.7/site-packages/flask/app.py", >>>>>>>>>>>>> line 1567, in handle_exception >>>>>>>>>>>>> reraise(exc_type, exc_value, tb) >>>>>>>>>>>>> File "/Users/dpage/.virtualenvs/pga >>>>>>>>>>>>> dmin4/lib/python2.7/site-packages/flask/app.py", >>>>>>>>>>>>> line 1988, in wsgi_app >>>>>>>>>>>>> response =3D self.full_dispatch_request() >>>>>>>>>>>>> File "/Users/dpage/.virtualenvs/pga >>>>>>>>>>>>> dmin4/lib/python2.7/site-packages/flask/app.py", >>>>>>>>>>>>> line 1641, in full_dispatch_request >>>>>>>>>>>>> rv =3D self.handle_user_exception(e) >>>>>>>>>>>>> File "/Users/dpage/.virtualenvs/pga >>>>>>>>>>>>> dmin4/lib/python2.7/site-packages/flask/app.py", >>>>>>>>>>>>> line 1544, in handle_user_exception >>>>>>>>>>>>> reraise(exc_type, exc_value, tb) >>>>>>>>>>>>> File "/Users/dpage/.virtualenvs/pga >>>>>>>>>>>>> dmin4/lib/python2.7/site-packages/flask/app.py", >>>>>>>>>>>>> line 1639, in full_dispatch_request >>>>>>>>>>>>> rv =3D self.dispatch_request() >>>>>>>>>>>>> File "/Users/dpage/.virtualenvs/pga >>>>>>>>>>>>> dmin4/lib/python2.7/site-packages/flask/app.py", >>>>>>>>>>>>> line 1625, in dispatch_request >>>>>>>>>>>>> return self.view_functions[rule.endpoint](**req.view_args= ) >>>>>>>>>>>>> File "/Users/dpage/.virtualenvs/pga >>>>>>>>>>>>> dmin4/lib/python2.7/site-packages/flask_login.py", >>>>>>>>>>>>> line 792, in decorated_view >>>>>>>>>>>>> return func(*args, **kwargs) >>>>>>>>>>>>> File "/Users/dpage/git/pgadmin4/web >>>>>>>>>>>>> /pgadmin/tools/sqleditor/__init__.py", >>>>>>>>>>>>> line 452, in get_columns >>>>>>>>>>>>> tid=3Dcommand_obj.obj_id) >>>>>>>>>>>>> AttributeError: 'QueryToolCommand' object has no attribute >>>>>>>>>>>>> 'obj_id' >>>>>>>>>>>>> >>>>>>>>>>>> =E2=80=8BFixed.=E2=80=8B >>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> 5) When I run the query again in pgAdmin III, then refresh th= e >>>>>>>>>>>>> data in >>>>>>>>>>>>> pgAdmin 4, the data_default_nulls column is displayed without >>>>>>>>>>>>> the >>>>>>>>>>>>> [null] marker (despite having a null value, which I confirmed >>>>>>>>>>>>> in >>>>>>>>>>>>> pgAdmin 3). >>>>>>>>>>>>> >>>>>>>>>>>> =E2=80=8BFixed.=E2=80=8B >>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> I'm sure there are other combinations of issues here. Please >>>>>>>>>>>>> fix and >>>>>>>>>>>>> thoroughly re-test to ensure behaviour is consistent - and to >>>>>>>>>>>>> avoid >>>>>>>>>>>>> future issues, please add some appropriate feature tests to >>>>>>>>>>>>> check >>>>>>>>>>>>> nulls, defaults and empty strings are properly handled in >>>>>>>>>>>>> view, insert >>>>>>>>>>>>> and updates. Murtuza recently wrote some feature tests for th= e >>>>>>>>>>>>> query >>>>>>>>>>>>> tool - you should be able to use those as a starting point. >>>>>>>>>>>>> >>>>>>>>>>>> =E2=80=8BAdded feature tests=E2=80=8B >>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> 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 >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> 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 >>>>>> >>>>> >>>>> >>>> >>>> >>>> -- >>>> 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 >> > > > > -- > Dave Page > Blog: http://pgsnake.blogspot.com > Twitter: @pgsnake > > EnterpriseDB UK: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > --001a11498cd4c5ea47054f276c1c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi = Dave,

On Wed= , May 10, 2017 at 2:06 PM, Dave Page <dpage@pgadmin.org> wro= te:
Any chance we can ge= t this wrapped up today Surinder?
=E2=80=8BI have fixed RM case, I am current= ly writing its feature test cases which is taking some time.
Should I send patch for RM ca= se only?=E2=80=8B I will try to complete test cases by today eod.

On Tue, May 9, 2017 at 11:29 AM, Dave Page <dpage@pgadmin= .org> wrote:


On Tue, May 9, 2017 = at 11:03 AM, Surinder Kumar <surinder.kumar@enterprisedb.com> wrote:
Hi Dave,

On Mon, May 8, 2017 at 4:37 PM, = Dave Page <dpage@pgadmin.org> wrote:


On M= on, May 8, 2017 at 11:51 AM, Surinder Kumar <surinder.kuma= r@enterprisedb.com> wrote:
Hi

On Mon, May 8, 2017 at 3:= 51 PM, Dave Page <dpage@pgadmin.org> wrote:
Hi

On Mon, May 8, 2017 at= 11:13 AM, Surinder Kumar <surinder.kumar@enterprisedb.com> wrote:
Hi Dave,

On = Mon, May 8, 2017 at 3:28 PM, Dave Page <dpage@pgadmin.org> w= rote:
Hi

On Fri, May 5, 2017 at 1= 2:52 PM, Surinder Kumar <surinder.kumar@enterprisedb.co= m> wrote:
Hi Dave,

=
The support to handle [null] and= [default] values is added for following formatters:
=C2=A0-=C2=A0JsonFormatter
=C2=A0-=C2=A0NumbersFormatter
=C2=A0-= =C2=A0CheckmarkFormatter
=C2=A0-=C2=A0T= extFormatter

Previously when a new row is added, it was not validating ea= ch and every cell for columns with attribute not_null =3D true.
I= ntroduced a new function=C2=A0validateRow(...)=C2=A0which is called on a= dding a new row, it validates each cell with column having attribute(not_nu= ll=3Dtrue). the corresponding cell will highlighted and save button will be= disabled if value is [null].

I'm not sure that behaviour is right. What I now see (given the t= able below) is that:

- If I click in the id field = of a new row, it forces me to enter a value or hit escape. Why is it trying= to force me? It's a serial field, so will get a value on save anyway.<= /div>
= =E2=80=8BYes, It is because I am validating all cell values after it render= s. It will reverted back.

- If = I do enter a value in the ID field, focus jumps over all the other fields w= ith either a default or no 'not null' option to the data_no_nulls c= olumn. Focus should always go to the next field.

I= think this addition can just be removed - I'm pretty sure the previous= behaviour would have been what we want, with the additional formatters fix= ed.=C2=A0
=E2=80=8BBut If i remove this addition, the value for column like = 'data_no_nulls' =E2=80=8Bwill be set to '' (blank string), = then on save its value will be validated on the server side and whatever th= e error message is will be returned back (the same behaviour as in pgAdmin3= )

Which is f= ine I think. If you want to leave the validation there, that's also fin= e - but, it a) shouldn't require me to press Esc if I decide not to fil= l in that value yet, and b) shouldn't change the tab order of the field= s. It's also broken of course, in that it was trying to force me to ent= er a value for a not-null field with a default.
=E2=80=8BYes, I will check i= f we just highlight the field and don't force the user to =E2=80=8Bente= r value.
This will enable user to edit = any field using TAB key even if required field is highlighted red.
Should the save button remains disable untill u= ser enters any valid value in 'data_no_nulls' column ?

I think that= 9;s fine, yes - as long as we get the validation right :-)=C2=A0
=E2=80= =8BFor highlighting the error field and enable user to navigate to other ce= lls using TAB key,
I spend some time lo= oking and debugging into the code and found that it requires lot of changes= in slick.grid.js core functions as there are no event listeners provided t= o =E2=80=8Blisten and changes in core file is not preferred. It may also br= eak other functionalities as code is quite complex.
So, I think we should validate data on server side and display= any error messages on UI.

OK.
=C2=A0
<= blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px= #ccc solid;padding-left:1ex">
<= div class=3D"gmail_quote">
=
=
=C2=A0
=C2= =A0

Now I will a= dd more feature test cases for remaining formatters. Will send separate pat= ch for feature test cases once completed.

=
Thanks.
=C2=A0

Please review updated patch.


On Tue, May 2, 2017 at 5:57 PM, Surinder Kumar <surinder.kumar@enterprisedb.com> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;pa= dding-left:1ex">
Hi Dave,

On Tue, = May 2, 2017 at 5:21 PM, Dave Page <dpage@pgadmin.org> wrote:=
Hi,

This is lookin= g much better now :-). Couple of thoughts and a bug:

- Only the TextFormatter seems to handle both [null] and [default] value= s. Shouldn't all formatters do so (including Json and Checkmark)?
=
=E2=80=8BYes, I wi= ll apply the same changes for other formatters too.=E2=80=8B
For example, "serial" columns currently get displa= yed as [null] when left blank, but I would expect to see [default].=C2=A0

- I would suggest we put [null] and [default] in a = lighter colour - #999999.

- With the feature test = patch added, I seem to be consistently getting the following failure (immed= iately after your new tests run):

=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
ER= ROR: runTest (pgadmin.feature_tests.xss_checks_panels_and_query_tool_t= est.CheckForXssFeatureTest)
Test XSS check for panels and qu= ery tool
---------------------------------------------------= -------------------
Traceback (most recent call last):=
=C2=A0 File "/Users/dpage/git/pgadmin4/web/regr= ession/feature_utils/base_feature_test.py", line 42, in setUp
=C2=A0 =C2=A0 self._screenshot()
=C2=A0 File "/Users/= dpage/git/pgadmin4/web/regression/feature_utils/base_feature_test= .py", line 92, in _screenshot
=C2=A0 =C2=A0 python_version))=
=C2=A0 File "/Users/dpage/.virtualenvs/pgadmin4/lib/py= thon2.7/site-packages/selenium/webdriver/remote/webdriver.py"= ;, line 802, in get_screenshot_as_file
=C2=A0 =C2=A0 png =3D self= .get_screenshot_as_png()
=C2=A0 File "/Users/dpage/.virtuale= nvs/pgadmin4/lib/python2.7/site-packages/selenium/webdriver/remot= e/webdriver.py", line 821, in get_screenshot_as_png
=C2= =A0 =C2=A0 return base64.b64decode(self.get_screenshot_as_base64().enc= ode('ascii'))
=C2=A0 File "/Users/dpage/.virtua= lenvs/pgadmin4/lib/python2.7/site-packages/selenium/webdriver/rem= ote/webdriver.py", line 831, in get_screenshot_as_base64
=C2=A0 =C2=A0 return self.execute(Command.SCREENSHOT)['value'= ;]
=C2=A0 File "/Users/dpage/.virtualenvs/pgadmin4/lib/= python2.7/site-packages/selenium/webdriver/remote/webdriver.py&qu= ot;, line 238, in execute
=C2=A0 =C2=A0 self.error_handler.check_= response(response)
=C2=A0 File "/Users/dpage/.virtualen= vs/pgadmin4/lib/python2.7/site-packages/selenium/webdriver/remote= /errorhandler.py", line 193, in check_response
=C2=A0 = =C2=A0 raise exception_class(message, screen, stacktrace)
Unexpec= tedAlertPresentException: Alert Text: None
Message: unexpect= ed alert open: {Alert text : Are you sure you wish to close the pgAdmin 4 b= rowser?}
=C2=A0 (Session info: chrome=3D58.0.3029.81)
= =C2=A0 (Driver info: chromedriver=3D2.29.461585 (0be2cd95f834e9ee7c46bcc7cf= 405b483f5ae83b),platform=3DMac OS X 10.12.3 x86_64)


=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D
ERROR: runTest (pgadmin.feature_tests.xss_c= hecks_pgadmin_debugger_test.CheckDebuggerForXssFeatureTest)
=
Test table DDL generation
----------------------------------------------------------------------
Traceback (m= ost recent call last):
=C2=A0 File "/Users/dpage/git/= pgadmin4/web/regression/feature_utils/base_feature_test.py",= line 42, in setUp
=C2=A0 =C2=A0 self._screenshot()
=C2= =A0 File "/Users/dpage/git/pgadmin4/web/regression/feature_utils/= base_feature_test.py", line 92, in _screenshot
=C2=A0 = =C2=A0 python_version))
=C2=A0 File "/Users/dpage/.virtualen= vs/pgadmin4/lib/python2.7/site-packages/selenium/webdriver/remote= /webdriver.py", line 802, in get_screenshot_as_file
=C2= =A0 =C2=A0 png =3D self.get_screenshot_as_png()
=C2=A0 File "= ;/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/s= elenium/webdriver/remote/webdriver.py", line 821, in get_screensh= ot_as_png
=C2=A0 =C2=A0 return base64.b64decode(self.get_screenshot_as_base64().encode('ascii'))
=C2=A0 File &qu= ot;/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages= /selenium/webdriver/remote/webdriver.py", line 831, in get_screen= shot_as_base64
=C2=A0 =C2=A0 return self.execute(Command.SCREENSH= OT)['value']
=C2=A0 File "/Users/dpage/.virtual= envs/pgadmin4/lib/python2.7/site-packages/selenium/webdriver/remo= te/webdriver.py", line 238, in execute
=C2=A0 =C2=A0 se= lf.error_handler.check_response(response)
=C2=A0 File "= /Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/se= lenium/webdriver/remote/errorhandler.py", line 193, in check_resp= onse
=C2=A0 =C2=A0 raise exception_class(message, screen, stacktr= ace)
UnexpectedAlertPresentException: Alert Text: None
=
Message: unexpected alert open: {Alert text : Are you sure you wish to= close the pgAdmin 4 browser?}
=C2=A0 (Session info: chrome=3D58.= 0.3029.81)
=C2=A0 (Driver info: chromedriver=3D2.29.461585 (0be2c= d95f834e9ee7c46bcc7cf405b483f5ae83b),platform=3DMac OS X 10.12.3 x86_6= 4)
=E2=80=8BSure. I will fix this.=E2=80=8B

Thanks!


On Fri, Apr 28, 2017 at 10:19 AM, Surinder Kumar <surinder.kumar@enterprisedb.com> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);pa= dding-left:1ex">
Hi Dave,

= Please find updated patch for RM case and a separate patch for Feature test= s.

Python:

- Added=C2=A0[default]= label for cells with default values while inserting a new row.

- = Introduced a FieldValidator function for cells that don't allow null va= lues. If user tries to insert null value, field with be highlighted with re= d =C2=A0 =C2=A0borders around.

=E2=80=8B-=C2=A0
If a = cell contains blank string('') and when we set it to null, the chan= ge into the cell is not detected. It was because the comparison
for (def= aultValue =3D=3D null) return true if defaultValue is undefined. Hence _.is= Null(value) is used to fix this.

Feature Test cases:

=C2=A0- Introduced a new method=C2=A0<= font style=3D"font-size:small;background-color:rgb(208,224,227)" color=3D"#= 000000">create_table_with_query(server, db_name, query)=C2=A0 i= n test_utils.py which executes the given query on connected server.

=C2=A0- Added a new file test_data.json that has test dat= a for test cases.


On Fri, Apr 7, 2017 at 2= :21 PM, Dave Page <dpage@pgadmin.org> wrote:
Hi

On Sat, Apr 1, 2017 at 12:45 PM, Surinder Kumar
<su= rinder.kumar@enterprisedb.com> wrote:
> Hi
>
> Issues fixed:
>
> 1. If a column is defined with a default modifier, there is now way to=
> insert the row with those defaults.
> The column will be left blank and it will take default value automatic= ally.
>
> 2. If a column has a not-null constraint then an error is returned and= the
> row is not inserted.
> The column will be left blank
>
> The default values for new added rows will be displayed on refresh/exe= cute.
>
> Please find attached patch and review.

This largely works as expected, but there is some weirdness. I have = a
test table that looks like this:

CREATE TABLE public.defaults
(
=C2=A0 =C2=A0 id bigint NOT NULL DEFAULT nextval('defaults_id_seq':= :regclass),
=C2=A0 =C2=A0 data_default_nulls text COLLATE pg_catalog."default"= ; DEFAULT 'abc123'::text,
=C2=A0 =C2=A0 data_default_no_nulls text COLLATE pg_catalog."default&q= uot; NOT NULL
DEFAULT 'def456'::text,
=C2=A0 =C2=A0 data_nulls text COLLATE pg_catalog."default",
=C2=A0 =C2=A0 data_no_nulls text COLLATE pg_catalog."default" NOT= NULL,
=C2=A0 =C2=A0 CONSTRAINT defaults_pkey PRIMARY KEY (id)
)

Remember that the expected behaviour is:

- Set a value to empty to update the column to null.
- Set a value to '' to update the column to an empty string
- Set a value to anything else to update the column to that value

1) In a row with values in each column, if I try to set the value of
data_default_nulls to null, the query executed is:

UPDATE public.defaults SET
data_default_nulls =3D '' WHERE
id =3D '2';

2) If I do the same in the data_nulls column, the value is immediately
shown as [null] and the query executed is:

UPDATE public.defaults SET
data_nulls =3D NULL WHERE
id =3D '2';

3) If I then edit the value in data_default_nulls, it shows the
current value as ''. Removing the quotes (to set it to null) doesn&= #39;t
get detected as a change.
=E2=80=8B=E2=80=8BTaken care.=C2=A0

4) When I manually executed "update defaults set data_default_nulls = =3D
null where id =3D 2" in a query tool window, I got:

2017-04-07 09:43:02,987: INFO werkzeug: 127.0.0.1 - - [07/Apr/2017
09:43:02] "GET /sqleditor/columns/8745675 HTTP/1.1" 500 -
Traceback (most recent call last):
=C2=A0 File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/sit= e-packages/flask/app.py",
line 2000, in __call__
=C2=A0 =C2=A0 return self.wsgi_app(environ, start_response)
=C2=A0 File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/sit= e-packages/flask/app.py",
line 1991, in wsgi_app
=C2=A0 =C2=A0 response =3D self.make_response(self.handle_exception(e)= )
=C2=A0 File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/sit= e-packages/flask/app.py",
line 1567, in handle_exception
=C2=A0 =C2=A0 reraise(exc_type, exc_value, tb)
=C2=A0 File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/sit= e-packages/flask/app.py",
line 1988, in wsgi_app
=C2=A0 =C2=A0 response =3D self.full_dispatch_request()
=C2=A0 File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/sit= e-packages/flask/app.py",
line 1641, in full_dispatch_request
=C2=A0 =C2=A0 rv =3D self.handle_user_exception(e)
=C2=A0 File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/sit= e-packages/flask/app.py",
line 1544, in handle_user_exception
=C2=A0 =C2=A0 reraise(exc_type, exc_value, tb)
=C2=A0 File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/sit= e-packages/flask/app.py",
line 1639, in full_dispatch_request
=C2=A0 =C2=A0 rv =3D self.dispatch_request()
=C2=A0 File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/sit= e-packages/flask/app.py",
line 1625, in dispatch_request
=C2=A0 =C2=A0 return self.view_functions[rule.endpoint](**req.view_arg= s)
=C2=A0 File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/sit= e-packages/flask_login.py",
line 792, in decorated_view
=C2=A0 =C2=A0 return func(*args, **kwargs)
=C2=A0 File "/Users/dpage/git/pgadmin4/web/pgadmin/tools/sqledito= r/__init__.py",
line 452, in get_columns
=C2=A0 =C2=A0 tid=3Dcommand_obj.obj_id)
AttributeError: 'QueryToolCommand' object has no attribute 'obj= _id'
=E2=80= =8BFixed.=E2=80=8B

5) When I run the query again in pgAdmin III, then refresh the data in
pgAdmin 4, the data_default_nulls column is displayed without the
[null] marker (despite having a null value, which I confirmed in
pgAdmin 3).
=E2=80=8B= Fixed.=E2=80=8B

I'm sure there are other combinations of issues here. Please fix and thoroughly re-test to ensure behaviour is consistent - and to avoid
future issues, please add some appropriate feature tests to check
nulls, defaults and empty strings are properly handled in view, insert
and updates. Murtuza recently wrote some feature tests for the query
tool - you should be able to use those as a starting point.
=E2=80=8BAdded feature tests=E2=80= =8B

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: @pgsnak= e

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Compa= ny





--
Dave= Page
Blog: ht= tp://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: = http://www.enterp= risedb.com
The Enterprise PostgreSQL Company




--
Dave Page
Blog: http://pgsnake.blogsp= ot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
T= he Enterprise PostgreSQL Company




--
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: @pgsna= ke

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Co= mpany

--001a11498cd4c5ea47054f276c1c--