pgAdmin 4 commit: Fix counted rows display in table properties. Fixes #

2017-11-02 Thread Dave Page
Fix counted rows display in table properties. Fixes #2836

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=897bf4857afe2f55aa5204f604b85417fb93c8c3
Author: Murtuza Zabuawala 

Modified Files
--
web/pgadmin/browser/__init__.py|  5 +++
.../servers/databases/schemas/tables/__init__.py   | 37 +-
.../templates/partition/sql/10_plus/properties.sql |  2 +-
.../templates/table/sql/10_plus/properties.sql |  2 +-
.../templates/table/sql/9.1_plus/properties.sql|  2 +-
.../table/sql/default/get_table_row_count.sql  |  1 +
.../templates/table/sql/default/properties.sql |  2 +-
.../table/sql/gpdb_5.0_plus/properties.sql |  2 +-
8 files changed, 47 insertions(+), 6 deletions(-)



Re: [pgAdmin4][Patch]: To handle long numbers for Rows (estimated) field in Table's properties

2017-11-02 Thread Dave Page
Thanks - patch applied.

On Thu, Nov 2, 2017 at 5:09 AM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Oops..that was due to float4->text (rel.reltuples::text) datatype casting
> in postgres.
>
> Please find updated patch.
>
>
> On Thu, Nov 2, 2017 at 2:31 AM, Dave Page  wrote:
>
>> Hi
>>
>> I created a table with:
>>
>> create table bigun as select * from generate_series(0, 100)
>>
>> I then selected it in the treeview, and it showed 0 for estimated rows,
>> and nothing at all for counted rows. I ran a vacuum full on the new table,
>> and now it fails to display the properties. On the console I see:
>>
>> Exception in thread Thread-1618:
>> Traceback (most recent call last):
>>   File 
>> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py",
>> line 810, in __bootstrap_inner
>> self.run()
>>   File 
>> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py",
>> line 763, in run
>> self.__target(*self.__args, **self.__kwargs)
>>   File 
>> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py",
>> line 602, in process_request_thread
>> self.handle_error(request, client_address)
>>   File 
>> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py",
>> line 599, in process_request_thread
>> self.finish_request(request, client_address)
>>   File 
>> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py",
>> line 334, in finish_request
>> self.RequestHandlerClass(request, client_address, self)
>>   File 
>> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py",
>> line 655, in __init__
>> self.handle()
>>   File 
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/serving.py",
>> line 200, in handle
>> rv = BaseHTTPRequestHandler.handle(self)
>>   File "/System/Library/Frameworks/Python.framework/Versions/2.7/li
>> b/python2.7/BaseHTTPServer.py", line 340, in handle
>> self.handle_one_request()
>>   File 
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/serving.py",
>> line 235, in handle_one_request
>> return self.run_wsgi()
>>   File 
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/serving.py",
>> line 177, in run_wsgi
>> execute(self.server.app)
>>   File 
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/serving.py",
>> line 165, in execute
>> application_iter = app(environ, start_response)
>>   File 
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>> line 2000, in __call__
>> return self.wsgi_app(environ, start_response)
>>   File 
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>> line 1991, 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 1567, in handle_exception
>> reraise(exc_type, exc_value, tb)
>>   File 
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>> line 1988, in wsgi_app
>> response = self.full_dispatch_request()
>>   File 
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>> line 1641, in full_dispatch_request
>> rv = self.handle_user_exception(e)
>>   File 
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>> line 1544, in handle_user_exception
>> reraise(exc_type, exc_value, tb)
>>   File 
>> "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
>> line 1639, in full_dispatch_request
>> rv = self.dispatch_request()
>>   File 
>> "/Users/dpage/.virtualenvs/pgadmin4/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/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
>> 242, in dispatch_request
>> return method(*args, **kwargs)
>>   File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups
>> /servers/databases/schemas/tables/utils.py", line 150, in wrap
>> return f(*args, **kwargs)
>>   File "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups
>> /servers/databases/schemas/tables/__init__.py", line 574, in properties
>> estimated_row_count = int(res['rows'][0].get('reltuples', 0))
>> ValueError: invalid literal for int() with base 10: '1e+06'
>>
>>
>> On Wed, Nov 1, 2017 at 4:28 PM, Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>> Hi Dave,
>>>
>>> Please find updated patch with suggested changes.
>>>
>>>
>>> On Wed, Nov 1, 2017 at 8:42 PM, Dave Page  wrote:
>>>
>

pgAdmin 4 commit: Ensure estimated rows are included correctly in CREAT

2017-11-02 Thread Dave Page
Ensure estimated rows are included correctly in CREATE script for functions. 
Fixes #2651

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=f73ce2dfc38d6c0ff86dc304580f3e5a971c993f
Author: Khushboo Vashi 

Modified Files
--
.../server_groups/servers/databases/schemas/functions/__init__.py   | 2 +-
.../schemas/functions/templates/function/pg/sql/9.2_plus/create.sql | 2 +-
.../schemas/functions/templates/function/pg/sql/9.2_plus/update.sql | 2 +-
.../schemas/functions/templates/function/pg/sql/9.5_plus/create.sql | 2 +-
.../schemas/functions/templates/function/pg/sql/9.5_plus/update.sql | 2 +-
.../schemas/functions/templates/function/pg/sql/9.6_plus/create.sql | 2 +-
.../schemas/functions/templates/function/pg/sql/9.6_plus/update.sql | 2 +-
.../schemas/functions/templates/function/pg/sql/default/create.sql  | 2 +-
.../schemas/functions/templates/function/ppas/sql/9.2_plus/create.sql   | 2 +-
.../schemas/functions/templates/function/ppas/sql/9.2_plus/update.sql   | 2 +-
.../schemas/functions/templates/function/ppas/sql/9.5_plus/create.sql   | 2 +-
.../schemas/functions/templates/function/ppas/sql/9.5_plus/update.sql   | 2 +-
.../schemas/functions/templates/function/ppas/sql/9.6_plus/create.sql   | 2 +-
.../schemas/functions/templates/function/ppas/sql/9.6_plus/update.sql   | 2 +-
.../schemas/functions/templates/function/ppas/sql/default/create.sql| 2 +-
.../schemas/functions/templates/function/ppas/sql/default/update.sql| 2 +-
.../schemas/functions/templates/procedure/ppas/sql/9.5_plus/create.sql  | 2 +-
.../schemas/functions/templates/procedure/ppas/sql/9.5_plus/update.sql  | 2 +-
.../schemas/functions/templates/procedure/ppas/sql/9.6_plus/create.sql  | 2 +-
.../schemas/functions/templates/procedure/ppas/sql/9.6_plus/update.sql  | 2 +-
.../functions/templates/trigger_function/pg/sql/9.2_plus/create.sql | 2 +-
.../functions/templates/trigger_function/pg/sql/9.2_plus/update.sql | 2 +-
.../functions/templates/trigger_function/pg/sql/9.5_plus/create.sql | 2 +-
.../functions/templates/trigger_function/pg/sql/9.5_plus/update.sql | 2 +-
.../functions/templates/trigger_function/pg/sql/default/create.sql  | 2 +-
.../functions/templates/trigger_function/pg/sql/default/update.sql  | 2 +-
.../functions/templates/trigger_function/ppas/sql/9.2_plus/create.sql   | 2 +-
.../functions/templates/trigger_function/ppas/sql/9.5_plus/create.sql   | 2 +-
.../functions/templates/trigger_function/ppas/sql/default/create.sql| 2 +-
29 files changed, 29 insertions(+), 29 deletions(-)



Re: [pgAdmin4][Patch]: RM #2651 : "Create Script" view of functions always shows "ROWS 0"

2017-11-02 Thread Dave Page
Thanks, applied.

On Thu, Nov 2, 2017 at 6:49 AM, Khushboo Vashi <
khushboo.va...@enterprisedb.com> wrote:

> Hi,
>
> Please find the attached patch to fix RM #2651 : "Create Script" view of
> functions always shows "ROWS 0".
>
> Right now function displays ROWS 0 in case of empty ROWS field. Now it
> will display correct value of the filed. This has been fixed in
> Create/Update/View function.
>
>
> Thanks,
> Khushboo
>



-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company