public inbox for [email protected]
help / color / mirror / Atom feedFrom: Khushboo Vashi <[email protected]>
To: Dave Page <[email protected]>
Cc: pgadmin-hackers <[email protected]>
Subject: Re: [pgAdmin4][Patch]: Fixed RM 2324 - PostGIS datatypes not showing up properly on SQL tab.
Date: Tue, 13 Jun 2017 09:15:40 +0530
Message-ID: <CAFOhELfSrw3mveC-y8oM8ft0zYjqXyg--eL8JrXX4W64eoONUg@mail.gmail.com> (raw)
In-Reply-To: <CA+OCxoysCoVVJEqNx7ZoYSpMQ_FYrY5+EA+GHPeHT2+wT87orw@mail.gmail.com>
References: <CAFOhELd8B=ALRSiZwEb0dVZwN8iGyCYu1=Tzk46A=MA3XTfu3w@mail.gmail.com>
<CAKKotZTUdfgBftsznMamYuLZB8SbK24FviwfQJ-7Hoqk_fnyhQ@mail.gmail.com>
<CAFOhELeXLioibqoyEGeB4EwGk=FC5D0DQqnX2ZnHiWYFrt4YuA@mail.gmail.com>
<CAKKotZSeqiwB8Jo8Hx_wBtp92q0kDF4Z_SN7oCt8abU76zjL9A@mail.gmail.com>
<CAFOhELe-Bmq9Ah=KWBP_2pPfqiYrpAUaP_hKp3-i-8CODEtoqQ@mail.gmail.com>
<CA+OCxoy6mynKBRDGf4LHXXj9mQHpcq0tP-QRqwzxSrEQWUhM2A@mail.gmail.com>
<CAFOhELdfX3u4PzOxmv5-e1E3kjqWZNTCh=7faGzxB-1=J1JRqA@mail.gmail.com>
<CA+OCxow4oGzbgVuXZVFfq56GNyVwR4F63YGpg=71Mamv+n96fQ@mail.gmail.com>
<CAFOhELfZmHJC=FoB5GXwrTaepxD1wQSrX9SyfKkK-Qt4Fs93hQ@mail.gmail.com>
<CA+OCxoxVcz4+t34maYgy+h9ZkC-gE-dnMMQ_oSLcivxTF9k3mg@mail.gmail.com>
<CAFOhELdv7VF4W3qFMcHaeVZ+PbVAkKyo6dOtdjmF+sEwFYp1CQ@mail.gmail.com>
<CA+OCxowscUtjRDQqStjpyPJsJQutOWiM0y28HNNuKbbxvz92hQ@mail.gmail.com>
<CA+OCxoysCoVVJEqNx7ZoYSpMQ_FYrY5+EA+GHPeHT2+wT87orw@mail.gmail.com>
List-Unsubscribe: <mailto:[email protected]?body=unsub%20pgadmin-hackers>
Hi,
On Mon, Jun 12, 2017 at 8:24 PM, Dave Page <[email protected]> wrote:
> Hi Khushboo,
>
> Looks like this patch broke the regressions tests :-(. Can you take a look
> ASAP please?
>
> please find the attached fix. However I didn't get any error while running
regression tests.
> Thanks!
>
> 2017-06-12 10:04:11,938: INFO werkzeug: 127.0.0.1 - - [12/Jun/2017
> 10:04:11] "GET /browser/table/sql/1/1/12669/2200/81920 HTTP/1.1" 500 -
> Traceback (most recent call last):
> File "/Users/pivotal/.pyenv/versions/2.7.10/envs/pgadmin/lib/
> python2.7/site-packages/flask/app.py", line 2000, in __call__
> return self.wsgi_app(environ, start_response)
> File "/Users/pivotal/.pyenv/versions/2.7.10/envs/pgadmin/lib/
> python2.7/site-packages/flask/app.py", line 1991, in wsgi_app
> response = self.make_response(self.handle_exception(e))
> File "/Users/pivotal/.pyenv/versions/2.7.10/envs/pgadmin/lib/
> python2.7/site-packages/flask/app.py", line 1567, in handle_exception
> reraise(exc_type, exc_value, tb)
> File "/Users/pivotal/.pyenv/versions/2.7.10/envs/pgadmin/lib/
> python2.7/site-packages/flask/app.py", line 1988, in wsgi_app
> response = self.full_dispatch_request()
> File "/Users/pivotal/.pyenv/versions/2.7.10/envs/pgadmin/lib/
> python2.7/site-packages/flask/app.py", line 1641, in full_dispatch_request
> rv = self.handle_user_exception(e)
> File "/Users/pivotal/.pyenv/versions/2.7.10/envs/pgadmin/lib/
> python2.7/site-packages/flask/app.py", line 1544, in handle_user_exception
> reraise(exc_type, exc_value, tb)
> File "/Users/pivotal/.pyenv/versions/2.7.10/envs/pgadmin/lib/
> python2.7/site-packages/flask/app.py", line 1639, in full_dispatch_request
> rv = self.dispatch_request()
> File "/Users/pivotal/.pyenv/versions/2.7.10/envs/pgadmin/lib/
> python2.7/site-packages/flask/app.py", line 1625, in dispatch_request
> return self.view_functions[rule.endpoint](**req.view_args)
> File "/Users/pivotal/.pyenv/versions/2.7.10/envs/pgadmin/lib/
> python2.7/site-packages/flask/views.py", line 84, in view
> return self.dispatch_request(*args, **kwargs)
> File "/Users/pivotal/workspace/pgadmin4/web/pgadmin/browser/utils.py",
> line 235, in dispatch_request
> return method(*args, **kwargs)
> File "/Users/pivotal/workspace/pgadmin4/web/pgadmin/browser/serve
> r_groups/servers/databases/schemas/tables/__init__.py", line 315, in wrap
> return f(*args, **kwargs)
> File "/Users/pivotal/workspace/pgadmin4/web/pgadmin/browser/serve
> r_groups/servers/databases/schemas/tables/__init__.py", line 2555, in sql
> data = self._formatter(did, scid, tid, data)
> File "/Users/pivotal/workspace/pgadmin4/web/pgadmin/browser/serve
> r_groups/servers/databases/schemas/tables/__init__.py", line 1081, in
> _formatter
> data = self._columns_formatter(tid, data)
> File "/Users/pivotal/workspace/pgadmin4/web/pgadmin/browser/serve
> r_groups/servers/databases/schemas/tables/__init__.py", line 663, in
> _columns_formatter
> column['attlen'] = matchObj.group(1)
> AttributeError: 'NoneType' object has no attribute 'group'
>
>
> On Mon, Jun 12, 2017 at 12:49 PM, Dave Page <[email protected]> wrote:
>
>> Thanks, applied.
>>
>> On Fri, Jun 9, 2017 at 10:18 AM, Khushboo Vashi <
>> [email protected]> wrote:
>>
>>> Hi,
>>>
>>> Please find the attached updated patch.
>>>
>>> Fixed the PostGIS Datatypes in SQL tab, Create / Update dialogues for
>>> Table, Column, Foreign Table and Type node.
>>>
>>> Regarding the review comment given by Dave (Also, I there should be a
>>> space between the , and value in the_geom geometry(MultiPolygon,3310).),
>>> won't be fixed as this format is returned by format_type() function itself.
>>>
>>> As per the conversation with Dave, I have logged RM #2473
>>> <https://redmine.postgresql.org/issues/2473; to add support for PostGIS
>>> Datatypes.
>>>
>>> Thanks,
>>> Khushboo
>>>
>>> On Tue, Jun 6, 2017 at 6:49 PM, Dave Page <[email protected]> wrote:
>>>
>>>>
>>>>
>>>> On Tue, Jun 6, 2017 at 2:15 PM, Khushboo Vashi <
>>>> [email protected]> wrote:
>>>>
>>>>>
>>>>>
>>>>> On 6 Jun 2017 18:36, "Dave Page" <[email protected]> wrote:
>>>>>
>>>>>
>>>>>
>>>>> On Tue, Jun 6, 2017 at 1:23 PM, Khushboo Vashi <
>>>>> [email protected]> wrote:
>>>>>
>>>>>>
>>>>>>
>>>>>> On 6 Jun 2017 17:42, "Dave Page" <[email protected]> wrote:
>>>>>>
>>>>>> Hi
>>>>>>
>>>>>> The table and column dialogues seem to have related problems. For
>>>>>> example, the table dialogue shows the length of the geometry field in the
>>>>>> test case as 847,380, whilst the column dialogue shows no length at all.
>>>>>>
>>>>>> What should be there in length and precision fields in this case?
>>>>>>
>>>>>
>>>>> I have no idea :-). What did pgAdmin 3 do here? I assume there's some
>>>>> way to decode the typmod into the desired values, and map them back to
>>>>> appropriate SQL.
>>>>>
>>>>> I will try to figure out the way.
>>>>> pgAdmin 3 has the same issue, so I have asked for the suggestion.
>>>>>
>>>>
>>>> Oh, OK - thanks. Maybe we need to reuse the length and precision fields
>>>> for these types. That is, I believe, essentially how PostGIS passes extra
>>>> info to the column definitions.
>>>>
>>>>
>>>>>
>>>>>
>>>>>> Also, I there should be a space between the , and value in the_geom
>>>>>> geometry(MultiPolygon,3310).
>>>>>>
>>>>>> Thanks.
>>>>>>
>>>>>> On Mon, Jun 5, 2017 at 8:32 AM, Khushboo Vashi <
>>>>>> [email protected]> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> Fixed PostGIS datatype on SQL tab for Table, column, Foreign Table
>>>>>>> and Type node.
>>>>>>>
>>>>>>> Please find the attached updated patch.
>>>>>>>
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Khushboo
>>>>>>>
>>>>>>> On Thu, Jun 1, 2017 at 6:36 PM, Murtuza Zabuawala <
>>>>>>> [email protected]> wrote:
>>>>>>>
>>>>>>>>
>>>>>>>> On Thu, Jun 1, 2017 at 5:27 PM, Khushboo Vashi <
>>>>>>>> [email protected]> wrote:
>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Thu, Jun 1, 2017 at 4:57 PM, Murtuza Zabuawala <
>>>>>>>>> [email protected]> wrote:
>>>>>>>>>
>>>>>>>>>> Hi Khushboo,
>>>>>>>>>>
>>>>>>>>>> Please include Type node and Foreign Table node in your fix :-)
>>>>>>>>>>
>>>>>>>>>> I don't think Type node requires this change.
>>>>>>>>>
>>>>>>>>> Yes, It do require because user can create composite type from
>>>>>>>> existing types.
>>>>>>>> [image: Inline image 1]
>>>>>>>>
>>>>>>>>> Foreign table changes added in the attached updated patch.
>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>>
>>>>>>>>> Thanks Murtuza for pointing this out.
>>>>>>>
>>>>>>>
>>>>>>>> Regards,
>>>>>>>>>> Murtuza Zabuawala
>>>>>>>>>> EnterpriseDB: http://www.enterprisedb.com
>>>>>>>>>> The Enterprise PostgreSQL Company
>>>>>>>>>>
>>>>>>>>>> On Thu, Jun 1, 2017 at 3:23 PM, Khushboo Vashi <
>>>>>>>>>> [email protected]> wrote:
>>>>>>>>>>
>>>>>>>>>>> Hi,
>>>>>>>>>>>
>>>>>>>>>>> Please find the attached patch to fix RM #2324 : PostGIS
>>>>>>>>>>> datatypes not showing up properly on SQL tab.
>>>>>>>>>>>
>>>>>>>>>>> Thanks,
>>>>>>>>>>> Khushboo
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>> Sent via pgadmin-hackers mailing list (
>>>>>>>>>>> [email protected])
>>>>>>>>>>> To make changes to your subscription:
>>>>>>>>>>> http://www.postgresql.org/mailpref/pgadmin-hackers
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Sent via pgadmin-hackers mailing list ([email protected]
>>>>>>> g)
>>>>>>> To make changes to your subscription:
>>>>>>> http://www.postgresql.org/mailpref/pgadmin-hackers
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> 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
>
--
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers
Attachments:
[image/png] image.png (71.5K, 3-image.png)
download | view image
[text/x-patch] RM_2324_fix.patch (5.0K, 4-RM_2324_fix.patch)
download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/__init__.py
index df9eb1a..f6fa65e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/__init__.py
@@ -657,19 +657,23 @@ class TableView(PGChildNodeView, DataTypeReader, VacuumSettings):
if 'elemoid' in column:
length, precision, typeval = self.get_length_precision(column['elemoid'])
+ # Set length and precision to None
+ column['attlen'] = None
+ column['attprecision'] = None
+
# If we have length & precision both
if length and precision:
matchObj = re.search(r'(\d+),(\d+)', fulltype)
- column['attlen'] = matchObj.group(1)
- column['attprecision'] = matchObj.group(2)
+ if matchObj:
+ column['attlen'] = matchObj.group(1)
+ column['attprecision'] = matchObj.group(2)
elif length:
# If we have length only
matchObj = re.search(r'(\d+)', fulltype)
- column['attlen'] = matchObj.group(1)
- column['attprecision'] = None
- else:
- column['attlen'] = None
- column['attprecision'] = None
+ if matchObj:
+ column['attlen'] = matchObj.group(1)
+ column['attprecision'] = None
+
SQL = render_template("/".join([self.column_template_path,
'is_referenced.sql']),
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/column/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/column/__init__.py
index 7a28cda..b5b88e9 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/column/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/column/__init__.py
@@ -348,21 +348,24 @@ class ColumnsView(PGChildNodeView, DataTypeReader):
if 'elemoid' in data:
length, precision, typeval = self.get_length_precision(data['elemoid'])
+ # Set length and precision to None
+ data['attlen'] = None
+ data['attprecision'] = None
+
import re
- # If we have length & precision both
+ # If we have length & precision both
if length and precision:
matchObj = re.search(r'(\d+),(\d+)', fulltype)
- data['attlen'] = matchObj.group(1)
- data['attprecision'] = matchObj.group(2)
+ if matchObj:
+ data['attlen'] = matchObj.group(1)
+ data['attprecision'] = matchObj.group(2)
elif length:
# If we have length only
matchObj = re.search(r'(\d+)', fulltype)
- data['attlen'] = matchObj.group(1)
- data['attprecision'] = None
- else:
- data['attlen'] = None
- data['attprecision'] = None
+ if matchObj:
+ data['attlen'] = matchObj.group(1)
+ data['attprecision'] = None
# We need to fetch inherited tables for each table
SQL = render_template("/".join([self.template_path,
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/__init__.py
index 8f02741..07df594 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/__init__.py
@@ -435,19 +435,22 @@ class TypeView(PGChildNodeView, DataTypeReader):
# Below logic will allow us to split length, precision from type name for grid
import re
+ t_len = None
+ t_prec = None
+
# If we have length & precision both
if is_tlength and is_precision:
matchObj = re.search(r'(\d+),(\d+)', row['fulltype'])
- t_len = matchObj.group(1)
- t_prec = matchObj.group(2)
+ if matchObj:
+ t_len = matchObj.group(1)
+ t_prec = matchObj.group(2)
elif is_tlength:
# If we have length only
matchObj = re.search(r'(\d+)', row['fulltype'])
- t_len = matchObj.group(1)
- t_prec = None
- else:
- t_len = None
- t_prec = None
+ if matchObj:
+ t_len = matchObj.group(1)
+ t_prec = None
+
type_name = DataTypeReader.parse_type_name(row['typname'])
view thread (15+ 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]: Fixed RM 2324 - PostGIS datatypes not showing up properly on SQL tab.
In-Reply-To: <CAFOhELfSrw3mveC-y8oM8ft0zYjqXyg--eL8JrXX4W64eoONUg@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