Re: [pgadmin-hackers] Patch for pgAdmin4 package on Mac OS X

2016-05-30 Thread Sandeep Thakkar
 Thanks. I have fixed all the issues.

Regarding the app not running from within the DMG for the first time, I was
unable to reproduce it on Zilan's machine which didn't have the development
env. On Murali's machine, it was reproducible for 1 time after couple of
attempts.

So, I just added the sync statement after settings the pythonpath value in
the settings. May be this will resolve the issue. Please confirm.
settings.sync();

Attached is the updated patch. Thanks.

On Fri, May 27, 2016 at 9:28 PM, Dave Page  wrote:

> On Fri, May 27, 2016 at 4:48 PM, Dave Page  wrote:
> >
> >
> > On Fri, May 27, 2016 at 1:11 PM, Sandeep Thakkar
> >  wrote:
> >>
> >> Sure. Thanks.
> >>
> >> There is a typo in pkg/mac/build.sh. i.e
> >>
> >> s/HTML_HELP/HELP_PATH/
> >>
> >>
> >> On Fri, May 27, 2016 at 5:26 PM, Dave Page  wrote:
> >>>
> >>> Not entirely - we definitely need to improve it. I'll review the code
> as
> >>> it is now though.
> >
> >
> > OK, review time :-)
> >
> > - The appbundle name should be created from APP_NAME.app in config.py,
> e.g.
> > 'pgAdmin 4.app'
> >
> > - The DMG name should be created from
> > to_lower(remove_spaces(APP_NAME-APP_VERSION)) in config.py, e.g.
> > pgadmin4-1.0-dev.dmg
> >
> > - Use #ifdef Q_OS_MAC in the QT code for Mac-specific code. There's no
> need
> > to define another macro.
> >
> > - Please add "MINIFY_HTML = False" to config_local.py (and have Paresh do
> > the same on his packages). This works around a code issue with the docs
> that
> > I'll log a bug for.
> >
> > - In testing, I found that running the app from within the DMG doesn't
> seem
> > to work the first time - it prompts for the path, then exits. Once I save
> > the path it offers, it's fine on subsequent runs.
> >
> > - Once copied to my laptop, I saw the same issue as above.
> >
> > Once these issues are resolved, I think we're good to commit.
>
> Oh, a couple more things:
>
> - There should not be a copy of the app bundle in dist/ following the
> build. Only the dmg should be there.
>
> - I think mac-build/ should be removed following a successful build,
> rather than waiting for make clean (please talk to Paresh - his code
> should do the same).
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>



-- 
Sandeep Thakkar


pgadmin-mac-appbundle-may30.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] [pgAdmin4][Patch]: Refresh CONCURRENTLY is not supported on materialized view for pg-9.3 server

2016-05-30 Thread Ashesh Vashi
Thanks - committed!

We needed separate templates for 9.4 due to this change, which I have added
with this commit.

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company



*http://www.linkedin.com/in/asheshvashi*


On Mon, May 30, 2016 at 11:01 AM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> Hi
>
> PFA patch for the *RM#1228*:
> "Refresh CONCURRENTLY is not supported on materialized view for pg-9.3
> server"
>
> Adds a check to hide "Refresh CONCURRENTLY" option on material view if
> server is pg-9.3
>
> Please review the patch.
>
> Thanks,
> Surinder Kumar
>
>
> --
> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers
>
>


[pgadmin-hackers] pgAdmin 4 commit: Support for the 'Refresh CONCURRENTLY' is applicable

2016-05-30 Thread Ashesh Vashi
Support for the 'Refresh CONCURRENTLY' is applicable only on the
database server >= 9.4.

Branch
--
master

Details
---
http://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=4aaa58352c93d66466682f93ff3acdf671b352b4
Author: Surinder Kumar 

Modified Files
--
.../servers/databases/schemas/views/__init__.py|  97 ++
.../schemas/views/templates/mview/js/mview.js  |  79 +---
.../templates/mview/pg/9.3_plus/sql/refresh.sql|   6 +-
.../views/templates/mview/pg/9.4_plus/sql/acl.sql  |  41 
.../templates/mview/pg/9.4_plus/sql/create.sql |  40 
.../templates/mview/pg/9.4_plus/sql/delete.sql |  13 ++
.../templates/mview/pg/9.4_plus/sql/get_schema.sql |   7 +
.../mview/pg/9.4_plus/sql/get_view_name.sql|  11 ++
.../templates/mview/pg/9.4_plus/sql/grant.sql  |   6 +
.../templates/mview/pg/9.4_plus/sql/properties.sql | 111 +++
.../templates/mview/pg/9.4_plus/sql/refresh.sql|   2 +
.../templates/mview/pg/9.4_plus/sql/update.sql | 214 +
.../templates/mview/pg/9.4_plus/sql/view_id.sql|   4 +
13 files changed, 563 insertions(+), 68 deletions(-)


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Re: [pgadmin-hackers] User management functionality patch [pgadmin4]

2016-05-30 Thread Ashesh Vashi
On Mon, May 30, 2016 at 4:09 PM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi Harshal,
>
> PFA comments as below,
>
> 1) While running setup.py for the first time, We did not handle the case
> to create Standard user.
> 2) Save button gets enable only clicking on input text box
> 3) Remove delete button from sub-node
> 4) If current user changes its own name/email, main page should reflect
> new changes.
>
>
> Can be listed as TODO
> 
> 1) Erros description is missing, for example when have user t...@test.com
> presnt and user try to add user same as t...@test.com we get error as
> "Error during saving user" it should be descriptive like "ERRPR: User {XYZ}
> is already exists.."
> 2) There should be an option to delete multiple users at one shot.
>
Let's not do it right now.
You can add as TODO.

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company



*http://www.linkedin.com/in/asheshvashi*


> 3) There should be an option to active/deactivate multiple users in one
> shot.
> 4) In-place editing in backgrid.
>
>
> Regards,
> Murtuza
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> On Fri, May 27, 2016 at 7:02 PM, Harshal Dhumal <
> harshal.dhu...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> PFA initial patch for User management functionality.
>>
>>
>> --
>> *Harshal Dhumal*
>> *Software Engineer *
>>
>>
>>
>> EenterpriseDB 
>>
>>
>> --
>> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgadmin-hackers
>>
>>
>


Re: [pgadmin-hackers] User management functionality patch [pgadmin4]

2016-05-30 Thread Murtuza Zabuawala
Hi Harshal,

PFA comments as below,

1) While running setup.py for the first time, We did not handle the case to
create Standard user.
2) Save button gets enable only clicking on input text box
3) Remove delete button from sub-node
4) If current user changes its own name/email, main page should reflect new
changes.


Can be listed as TODO

1) Erros description is missing, for example when have user t...@test.com
presnt and user try to add user same as t...@test.com we get error as
"Error during saving user" it should be descriptive like "ERRPR: User {XYZ}
is already exists.."
2) There should be an option to delete multiple users at one shot.
3) There should be an option to active/deactivate multiple users in one
shot.
4) In-place editing in backgrid.


Regards,
Murtuza

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

On Fri, May 27, 2016 at 7:02 PM, Harshal Dhumal <
harshal.dhu...@enterprisedb.com> wrote:

> Hi,
>
> PFA initial patch for User management functionality.
>
>
> --
> *Harshal Dhumal*
> *Software Engineer *
>
>
>
> EenterpriseDB 
>
>
> --
> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers
>
>


Re: [pgadmin-hackers] JSON serialization in pgAdmin 4

2016-05-30 Thread Ashesh Vashi
On Sat, May 28, 2016 at 11:08 PM, Lele Gaifax  wrote:

> Ashesh Vashi  writes:
>
> > On Sat, May 28, 2016 at 7:59 PM, Lele Gaifax 
> wrote:
> >> I'd like to know if there is already a plan to properly handle
> >> date/timestamp
> >> fields, that currently fail with an error because simplejson by default
> >> does
> >> not know how the serialize (or deserialize) those data types.
> >
> > Can you please share some more detailed information about it, where/in
> > which condition it does fail?
>
> Consider the following simple table:
>
> testdb=# \d users
>  Table "public.users"
>   Column   |Type|   Modifiers
> ---++
>  id| integer| not null
>  name  | character varying  |
>  fullname  | character varying  |
>  birthdate | date   | not null
>
> testdb=# select * from users;
>  id | name  |fullname| birthdate
> +---++
>   1 | jack  | Jack Jones | 1987-01-02
>   2 | wendy | Wendy Williams | 1978-01-02
> (2 rows)
>
> Then, executing the "View first 100 rows" action, I get
>
>  500
> Internal Server Error Internal Server Error The
> server
> encountered an internal error and was unable to complete your
> request. Either the server is overloaded or there is an error in the
> application.
>
> with the following traceback (slightly edited for brevity)
>
> 2016-05-28 19:15:52,824: ERROR  pgadmin:Exception on
> /sqleditor/poll/7927153 [GET]
> Traceback (most recent call last):
>   ...
>   File ".../pgadmin4/web/pgadmin/utils/ajax.py", line 41, in
> make_json_response
> response=json.dumps(doc, cls=DataTypeJSONEncoder),
>   File ".../python3.6/site-packages/simplejson/__init__.py", line 386,
> in dumps
> **kw).encode(obj)
>   File ".../python3.6/site-packages/simplejson/encoder.py", line 269,
> in encode
> chunks = self.iterencode(o, _one_shot=True)
>   File ".../python3.6/site-packages/simplejson/encoder.py", line 348,
> in iterencode
> return _iterencode(o, 0)
>   File ".../pgadmin4/web/pgadmin/utils/ajax.py", line 26, in default
> return json.JSONEncoder.default(self, obj)
>   File ".../python3.6/site-packages/simplejson/encoder.py", line 246,
> in default
> raise TypeError(repr(o) + " is not JSON serializable")
> TypeError: datetime.date(1987, 1, 2) is not JSON serializable
>
> As said, the DataTypeJSONEncoder could be extended to handle dates and
> times
> as well as datetimes and Decimals. BTW, the latter are already supported by
> simplejson:
>
> >>> import simplejson
> >>> import decimal
> >>> d = decimal.Decimal('3.14159')
> >>> simplejson.dumps([d])
> '[3.14159]'
>
> OTOH, the following is with nssjson:
>
> Python 2.7.11+ (default, May  9 2016, 15:54:33)
> [GCC 5.3.1 20160429] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import datetime, uuid
> >>> import nssjson
> >>> now = datetime.datetime.now()
> >>> today = datetime.date.today()
> >>> time = now.time()
> >>> uid = uuid.uuid1()
> >>> nssjson.dumps([uid, now, today, time], iso_datetime=True,
> handle_uuid=True)
> '["2d628922-24f9-11e6-b746-3085a99ccac7",
> "2016-05-28T19:25:26.109827", "2016-05-28", "19:25:26.109827"]'
> >>> nssjson.loads(_, iso_datetime=True, handle_uuid=True)
> [UUID('2d628922-24f9-11e6-b746-3085a99ccac7'), datetime.datetime(2016,
> 5, 28, 19, 25, 26, 109827), datetime.date(2016, 5, 28), datetime.time(19,
> 25, 26, 109827)]
>
> possibly using its C accelerator to serialize/deserialize those types.
>

Thanks for the information.

Akshay,

Please take a look at it, and see what we can do about it.

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company



*http://www.linkedin.com/in/asheshvashi*


>
> ciao, lele.
> --
> nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
> real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
> l...@metapensiero.it  | -- Fortunato Depero, 1929.
>
>
>
> --
> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers
>


Re: [pgadmin-hackers] [pgAdmin4][Patch]: RM#1243 - Columns on the Query Tool should be sizeable

2016-05-30 Thread Ashesh Vashi
On Fri, May 27, 2016 at 6:27 PM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> Hi
>
> Please find updated patch with following changes:
>
>1. Replaced the outdated code for *Backgrid Sizeable Columns plugin *with
>https://github.com/FortesSolutions/backgrid-sizeable-columns library
>because the updated code is available here.
>2. I have figured out to calculate *offset* using the parameters of
>listener provided, so we need not to tweak the original library code.
>
> As per our conversation, the sizeHandler is not calculating the position
without resizing.
It should calculate the position even after rendering is completed.

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company



*http://www.linkedin.com/in/asheshvashi*


>
> On Fri, May 27, 2016 at 5:00 PM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>>
>>
>> On Fri, May 27, 2016 at 4:43 PM, Dave Page  wrote:
>>
>>> Hi
>>>
>>> On Fri, May 27, 2016 at 12:07 PM, Surinder Kumar
>>>  wrote:
>>> > Hi
>>> >
>>> > Added support for Columns resizable in query tool. It allows user to
>>> resize
>>> > the table columns as much as needed.
>>> >
>>> > We are using Backgrid Sizeable Columns plugin:
>>> > https://github.com/WRidder/backgrid-sizeable-columns
>>> >
>>> > with one change in library on line no 185:
>>> > moved the following trigger event out of if condition:
>>> >
>>> > if (newWidth != oldWidth) {
>>> >
>>> > }
>>> >
>>> >
>>> > and added one additional parameter offset.
>>> > //Trigger event
>>> >
>>> > view.columns.trigger("resize", columnModel, newWidth, oldWidth,
>>> offset);
>>> >
>>> >
>>> > We are listening to this trigger event in sqleditor.js file where we
>>> need
>>> > offset
>>> > to calculate new table width on every resize event.
>>>
>>> Please ensure any changes to third party libraries are submitted
>>> upstream.
>>>
>> yes, sure.
>>
>>>
>>> > hence, here is the patch attached.
>>>
>>> ENOATTACHMENT!
>>>
>>> --
>>> 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
>>>
>>
>>
>
>
> --
> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers
>
>