Re: [pgadmin-hackers] PATCH:Treeview item sorting (pgAdmin4)

2016-05-28 Thread Ashesh Vashi
On Fri, May 27, 2016 at 7:34 PM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi,
>
> PFA patch, To address RM#1244.
>
> Now we are sorting all collection nodes based on it's labels.
>
The patch takes care sorting the nodes at server side.
When we rename a node, or add a new node object, we will need to add the
necessary logic at client side.

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company



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


>
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: 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
>
>


Re: [pgadmin-hackers] [pgadmin4][PATCH][PATCH]: RM 1113: casts should be alphabetical order

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

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company



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


On Fri, May 27, 2016 at 6:44 PM, Sanket Mehta  wrote:

> Hi,
>
> Please find the patch for pgadmin4 RM 1113 attached with this mail.
> Please review it and commit.
>
> Regards,
> Sanket Mehta
> Sr Software engineer
> Enterprisedb
>
>
> --
> 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: Fixes #1113 - Casts should be in alphabetical order.

2016-05-28 Thread Ashesh Vashi
Fixes #1113 - Casts should be in alphabetical order.

Branch
--
master

Details
---
http://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=2fb1e96e2fc5ef0b0667298c97c0ce8c74ebcf15
Author: Sanket Mehta 

Modified Files
--
.../servers/databases/casts/templates/cast/sql/9.1_plus/nodes.sql  | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)


-- 
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] PATCH: To fix the issue while adding first server (pgAdmin4)

2016-05-28 Thread Ashesh Vashi
On Fri, May 27, 2016 at 4:22 PM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi,
>
> PFA patch to fix the issue when we add first server in pgAdmin4.
> (RM#1104)
>
This is too hardcoded.

We need a very generic resolution for this problem.
i.e.
Let's say - I have another server group, and when we add new server to that
server-group.
This solution wont work.

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company



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


>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: 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
>
>


[pgadmin-hackers] pgAdmin 4 commit: Fixes #1143 - Update the comments in edit mode for th

2016-05-28 Thread Ashesh Vashi
Fixes #1143 - Update the comments in edit mode for the foreign data
wrapper, and foreign table objects.

Branch
--
master

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

Modified Files
--
.../foreign_servers/templates/foreign_servers/sql/9.1_plus/update.sql   | 2 +-
.../foreign_servers/templates/foreign_servers/sql/9.3_plus/update.sql   | 2 +-
.../templates/foreign_data_wrappers/sql/9.1_plus/update.sql | 2 +-
.../templates/foreign_data_wrappers/sql/9.3_plus/update.sql | 2 +-
.../foreign_tables/templates/foreign_tables/sql/9.1_plus/update.sql | 2 +-
.../foreign_tables/templates/foreign_tables/sql/9.2_plus/update.sql | 2 +-
.../foreign_tables/templates/foreign_tables/sql/9.5_plus/update.sql | 2 +-
7 files changed, 7 insertions(+), 7 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] PATCH: To fix issue in updating comments (pgAdmin4)

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

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company



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


On Fri, May 27, 2016 at 11:51 AM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi,
>
> PFA patch to fix the issue in updating comments in foreign data
> wrapper/foreign table.
> (RM#1143)
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: 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
>
>


[pgadmin-hackers] pgAdmin 4 commit: Fixes #1142 - Update the comments in edit mode for th

2016-05-28 Thread Ashesh Vashi
Fixes #1142 - Update the comments in edit mode for the function,
procedure, trigger function nod objects.

Branch
--
master

Details
---
http://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=100f075510787a8d85f8d0474103167308a1e5ab
Author: Murtuza Zabuawala 

Modified Files
--
.../schemas/functions/templates/function/pg/sql/9.1_plus/update.sql | 2 +-
.../schemas/functions/templates/function/pg/sql/9.2_plus/update.sql | 2 +-
.../schemas/functions/templates/function/pg/sql/9.5_plus/update.sql | 2 +-
.../schemas/functions/templates/function/ppas/sql/9.1_plus/update.sql   | 2 +-
.../schemas/functions/templates/function/ppas/sql/9.2_plus/update.sql   | 2 +-
.../schemas/functions/templates/function/ppas/sql/9.5_plus/update.sql   | 2 +-
.../schemas/functions/templates/procedure/ppas/sql/9.1_plus/update.sql  | 2 +-
.../schemas/functions/templates/procedure/ppas/sql/9.2_plus/update.sql  | 2 +-
.../schemas/functions/templates/procedure/ppas/sql/9.5_plus/update.sql  | 2 +-
.../functions/templates/trigger_function/pg/sql/9.1_plus/update.sql | 2 +-
.../functions/templates/trigger_function/pg/sql/9.2_plus/update.sql | 2 +-
.../functions/templates/trigger_function/pg/sql/9.5_plus/update.sql | 2 +-
.../functions/templates/trigger_function/ppas/sql/9.1_plus/update.sql   | 2 +-
.../functions/templates/trigger_function/ppas/sql/9.2_plus/update.sql   | 2 +-
.../functions/templates/trigger_function/ppas/sql/9.5_plus/update.sql   | 2 +-
15 files changed, 15 insertions(+), 15 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] PATCH: To fix issue in removing comments in edit mode (pgAdmin4)

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

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company



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


On Fri, May 27, 2016 at 11:40 AM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi,
>
> PFA patch to fix the issue in function/procedure/trigger-function node
> while updating comments.
> (RM#1142)
>
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: 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
>
>


[pgadmin-hackers] JSON serialization in pgAdmin 4

2016-05-28 Thread Lele Gaifax
Hi all,

first of all, let me congratulate with you for how good pgAdmin 4 is quickly
becoming. I tried it now and then, and I'm always surprised by the amount of
effort you spend on it, thank you!

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.

One minimalistic approach would be subclassing the JSONEncoder and overriding
its default() method. This would solve the serialization problem, but I guess
that sooner or later we may want to support also the other way around.

One further step in that direction could be using nssjson[1] (my fork of
simplejson that supports date/time/datetime/UUID out of the box). I
reimplemented the same functionality on top of python-rapidjson, but the
author didn't accept my PR[2] yet. Rapidjson is much faster on most
operations, but it's also very young...

Thanks in advance,
ciao, lele.

[1] https://pypi.python.org/pypi/nssjson
[2] https://github.com/kenrobbins/python-rapidjson/pull/35
-- 
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] JSON serialization in pgAdmin 4

2016-05-28 Thread Ashesh Vashi
Hi Emanuele,

On Sat, May 28, 2016 at 7:59 PM, Lele Gaifax  wrote:

> Hi all,
>
> first of all, let me congratulate with you for how good pgAdmin 4 is
> quickly
> becoming. I tried it now and then, and I'm always surprised by the amount
> of
> effort you spend on it, thank you!
>
Thanks!

>
> 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.
>
Thanks for sharing the information.

Can you please share some more detailed information about it, where/in
which condition it does fail?

>
> One minimalistic approach would be subclassing the JSONEncoder and
> overriding
> its default() method. This would solve the serialization problem, but I
> guess
> that sooner or later we may want to support also the other way around.
>
Yeah - that's what we've done at one place.

>
> One further step in that direction could be using nssjson[1] (my fork of
> simplejson that supports date/time/datetime/UUID out of the box). I
> reimplemented the same functionality on top of python-rapidjson, but the
> author didn't accept my PR[2] yet. Rapidjson is much faster on most
> operations, but it's also very young...
>
We would certainly like to take a look at it.
Thanks for sharing the information.

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company



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


>
> Thanks in advance,
> ciao, lele.
>
> [1] https://pypi.python.org/pypi/nssjson
> [2] https://github.com/kenrobbins/python-rapidjson/pull/35
> --
> 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] JSON serialization in pgAdmin 4

2016-05-28 Thread Lele Gaifax
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.

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