[pgadmin-hackers] [pgAdmin4][Patch]: CanDrop option is missing for newly created database

2016-07-12 Thread Surinder Kumar
Hi

I found this issue while working on an RM case.

*Solution:*
setting *canDrop* flag to True fix the issue.

Please find attached patch with fix and review.


Thanks,
Surinder Kumar


canDrop_missing_for_new_created_db.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


[pgadmin-hackers] pgAdmin 4 commit: 'hasattr' function on '__builtins__' for 'xrange' fun

2016-07-12 Thread Ashesh Vashi
'hasattr' function on '__builtins__' for 'xrange' function does not
return correct information from a script, but works well on interactive
shell. Used a more proper check for Python > 2 instead of the current
implementation.

Thanks Vishal for the report.

Branch
--
master

Details
---
http://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=1ada5031cdfcaf4c4a9ae00ee2e97b3e58d5b0fa

Modified Files
--
web/pgadmin/__init__.py | 2 +-
1 file changed, 1 insertion(+), 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


[pgadmin-hackers] PATCH: Unable to create procedure (pgAdmin4)

2016-07-12 Thread Murtuza Zabuawala
Hi,

PFA patch to fixed the issue in procedure node where user were not able to
create new procedure when they provide arguments.
(RM#1449)

To fix the issue we used qtTypeIdent in sql template for datatype, earlier
it was qtIdent which was causing issue.


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


RM_1449.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


[pgadmin-hackers] pgAdmin 4 feedback

2016-07-12 Thread Michael Hornick
Hello team - great work!

We have been using Postrgres as the main database for our insurance product for 
over 10 years, and it has been a great experience so far.  Personally, I have 
been using a product called AQT to do most of my Postgres SQL work - mainly 
because of the lack of "features" offered in pgAdmin III.  Although, most 
developers in our company indeed use pgAdmin III.  Thankfully, it seems that 
some great headway is now being made.  Let me know if you want a list of 
features that I use daily on AQT that I would like to see in pgAdmin - I would 
be happy to list and explain those in order of usefulness.

Issues:


My first issue with the new pgAdmin 4 is that the numeric fields seem to add 
commas and ".00" in the table listings.  I would need a way to turn this 
feature off before I could use pgAdmin 4.  The reason is that we use numeric 
19,0 often as a record object ID in many fields within our over 700 database 
tables.  These fields always contain 19 digits, and it seems impossible to 
easily read these fields using this new listing format.


I have no idea how many testers are providing feedback.  So, please let me know 
if having another user providing feedback is useful or not.  If not, I will 
wait until the final release and take a look then.

Thanks.

Mike

.

Michael Hornick

Architect | Insurance Systems Inc.



[cid:image001.png@01D1DB8E.8DB874D0]

T: (416) 249-2260  | 1-877-777-2231 Ext. 319

M: (416) 704-9250

E:   mhorn...@insurancesystems.com
Skype: mhorn...@insurancesystems.com

__


This e-mail is intended for the person(s) to whom it is addressed and may 
contain information which is PRIVILEGED or CONFIDENTIAL. Any unauthorized use, 
distribution, copying or disclosure by any person other than the addressee(s) 
is strictly prohibited. If you have received this e-mail in error, please 
notify the sender immediately by return mail and delete the message and any 
attachments from your system.



[pgadmin-hackers] [pgAdmin4][Patch]: Regarding RM#1419 - Internal Server Error displayed if create any object through simplified Chinese character

2016-07-12 Thread Surinder Kumar
Hi

*What is happening in code?*
Database is created with Chinese characters successfully with ascii
values(Chinese characters converted to ascii) before saving internally.

but when database properties is retrieved by name, it fails to fetch data
and throws UnicodeError.

*Solution:*
Database name should be encoded in 'utf-8' before storing to database.
This resolved the issue.
I have tested this patch by creating database name using Japanese and
Chinese characters. It works.

Also referenced the code to *set default encoding to 'uff-8' *before start
of application.
https://github.com/joeyespo/grip/issues/86

@Ashesh/@Dave can you please review the patch?
If it looks good, we can do the same changes in case of other nodes.

Thanks,
Surinder Kumar


RM#1419.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]: Regarding RM#1419 - Internal Server Error displayed if create any object through simplified Chinese character

2016-07-12 Thread Murtuza Zabuawala
Hi,

Just a heads up, This issue is occurs only in runtime & If you try in web
everything works fine when you provide unicode characters as object name.

Now sure but the issue is when runtime(QtWebkit) sends data it does not
encodes it properly & this should be generic fix in runtime.

Regards,
Murtuza

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

On Tue, Jul 12, 2016 at 3:27 PM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> Hi
>
> *What is happening in code?*
> Database is created with Chinese characters successfully with ascii
> values(Chinese characters converted to ascii) before saving internally.
>
> but when database properties is retrieved by name, it fails to fetch data
> and throws UnicodeError.
>
> *Solution:*
> Database name should be encoded in 'utf-8' before storing to database.
> This resolved the issue.
> I have tested this patch by creating database name using Japanese and
> Chinese characters. It works.
>
> Also referenced the code to *set default encoding to 'uff-8' *before
> start of application.
> https://github.com/joeyespo/grip/issues/86
>
> @Ashesh/@Dave can you please review the patch?
> If it looks good, we can do the same changes in case of other nodes.
>
> 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
>
>


Re: [pgadmin-hackers] [pgAdmin4][Patch]: Regarding RM#1419 - Internal Server Error displayed if create any object through simplified Chinese character

2016-07-12 Thread Surinder Kumar
On Tue, Jul 12, 2016 at 3:43 PM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi,
>
> Just a heads up, This issue is occurs only in runtime & If you try in web
> everything works fine when you provide unicode characters as object name.
>
No, this issue is reported for both web and runtime application. It is
reproducible to me in web application.

>
> Now sure but the issue is when runtime(QtWebkit) sends data it does not
> encodes it properly & this should be generic fix in runtime.
>
> Regards,
> Murtuza
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> On Tue, Jul 12, 2016 at 3:27 PM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi
>>
>> *What is happening in code?*
>> Database is created with Chinese characters successfully with ascii
>> values(Chinese characters converted to ascii) before saving internally.
>>
>> but when database properties is retrieved by name, it fails to fetch data
>> and throws UnicodeError.
>>
>> *Solution:*
>> Database name should be encoded in 'utf-8' before storing to database.
>> This resolved the issue.
>> I have tested this patch by creating database name using Japanese and
>> Chinese characters. It works.
>>
>> Also referenced the code to *set default encoding to 'uff-8' *before
>> start of application.
>> https://github.com/joeyespo/grip/issues/86
>>
>> @Ashesh/@Dave can you please review the patch?
>> If it looks good, we can do the same changes in case of other nodes.
>>
>> 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
>>
>>
>


Re: [pgadmin-hackers] [pgAdmin4][Patch]: Regarding RM#1419 - Internal Server Error displayed if create any object through simplified Chinese character

2016-07-12 Thread Murtuza Zabuawala
May be because of Python2.7 but if you try in Python3. It works.

we can use PEP 0263  to fix this
issue.  // # -*- coding: utf-8 -*-


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

On Tue, Jul 12, 2016 at 3:48 PM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> On Tue, Jul 12, 2016 at 3:43 PM, Murtuza Zabuawala <
> murtuza.zabuaw...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> Just a heads up, This issue is occurs only in runtime & If you try in web
>> everything works fine when you provide unicode characters as object name.
>>
> No, this issue is reported for both web and runtime application. It is
> reproducible to me in web application.
>
>>
>> Now sure but the issue is when runtime(QtWebkit) sends data it does not
>> encodes it properly & this should be generic fix in runtime.
>>
>> Regards,
>> Murtuza
>>
>> --
>> Regards,
>> Murtuza Zabuawala
>> EnterpriseDB: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>> On Tue, Jul 12, 2016 at 3:27 PM, Surinder Kumar <
>> surinder.ku...@enterprisedb.com> wrote:
>>
>>> Hi
>>>
>>> *What is happening in code?*
>>> Database is created with Chinese characters successfully with ascii
>>> values(Chinese characters converted to ascii) before saving internally.
>>>
>>> but when database properties is retrieved by name, it fails to fetch
>>> data and throws UnicodeError.
>>>
>>> *Solution:*
>>> Database name should be encoded in 'utf-8' before storing to database.
>>> This resolved the issue.
>>> I have tested this patch by creating database name using Japanese and
>>> Chinese characters. It works.
>>>
>>> Also referenced the code to *set default encoding to 'uff-8' *before
>>> start of application.
>>> https://github.com/joeyespo/grip/issues/86
>>>
>>> @Ashesh/@Dave can you please review the patch?
>>> If it looks good, we can do the same changes in case of other nodes.
>>>
>>> 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
>>>
>>>
>>
>


Re: [pgadmin-hackers] [pgAdmin4][Patch]: Regarding RM#1419 - Internal Server Error displayed if create any object through simplified Chinese character

2016-07-12 Thread Surinder Kumar
On Tue, Jul 12, 2016 at 3:48 PM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> On Tue, Jul 12, 2016 at 3:43 PM, Murtuza Zabuawala <
> murtuza.zabuaw...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> Just a heads up, This issue is occurs only in runtime & If you try in web
>> everything works fine when you provide unicode characters as object name.
>>
> No, this issue is reported for both web and runtime application. It is
> reproducible to me in web application.
>
It is reproducible for me on
Mac OS X Yosemite version 10.10.2
Python version: 2.7
Browsers: Chrome & Firefox.

>
>> Now sure but the issue is when runtime(QtWebkit) sends data it does not
>> encodes it properly & this should be generic fix in runtime.
>>
>> Regards,
>> Murtuza
>>
>> --
>> Regards,
>> Murtuza Zabuawala
>> EnterpriseDB: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>> On Tue, Jul 12, 2016 at 3:27 PM, Surinder Kumar <
>> surinder.ku...@enterprisedb.com> wrote:
>>
>>> Hi
>>>
>>> *What is happening in code?*
>>> Database is created with Chinese characters successfully with ascii
>>> values(Chinese characters converted to ascii) before saving internally.
>>>
>>> but when database properties is retrieved by name, it fails to fetch
>>> data and throws UnicodeError.
>>>
>>> *Solution:*
>>> Database name should be encoded in 'utf-8' before storing to database.
>>> This resolved the issue.
>>> I have tested this patch by creating database name using Japanese and
>>> Chinese characters. It works.
>>>
>>> Also referenced the code to *set default encoding to 'uff-8' *before
>>> start of application.
>>> https://github.com/joeyespo/grip/issues/86
>>>
>>> @Ashesh/@Dave can you please review the patch?
>>> If it looks good, we can do the same changes in case of other nodes.
>>>
>>> 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
>>>
>>>
>>
>


Re: [pgadmin-hackers] [pgAdmin4][Patch]: Regarding RM#1419 - Internal Server Error displayed if create any object through simplified Chinese character

2016-07-12 Thread Ashesh Vashi
On Tue, Jul 12, 2016 at 3:58 PM, Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> May be because of Python2.7 but if you try in Python3. It works.
>
> we can use PEP 0263  to fix
> this issue.  // # -*- coding: utf-8 -*-
>
Isn't this about the source code encoding, and not about the input encoding?

--

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
>
> On Tue, Jul 12, 2016 at 3:48 PM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> On Tue, Jul 12, 2016 at 3:43 PM, Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> Just a heads up, This issue is occurs only in runtime & If you try in
>>> web everything works fine when you provide unicode characters as object
>>> name.
>>>
>> No, this issue is reported for both web and runtime application. It is
>> reproducible to me in web application.
>>
>>>
>>> Now sure but the issue is when runtime(QtWebkit) sends data it does not
>>> encodes it properly & this should be generic fix in runtime.
>>>
>>> Regards,
>>> Murtuza
>>>
>>> --
>>> Regards,
>>> Murtuza Zabuawala
>>> EnterpriseDB: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>> On Tue, Jul 12, 2016 at 3:27 PM, Surinder Kumar <
>>> surinder.ku...@enterprisedb.com> wrote:
>>>
 Hi

 *What is happening in code?*
 Database is created with Chinese characters successfully with ascii
 values(Chinese characters converted to ascii) before saving internally.

 but when database properties is retrieved by name, it fails to fetch
 data and throws UnicodeError.

 *Solution:*
 Database name should be encoded in 'utf-8' before storing to database.
 This resolved the issue.
 I have tested this patch by creating database name using Japanese and
 Chinese characters. It works.

 Also referenced the code to *set default encoding to 'uff-8' *before
 start of application.
 https://github.com/joeyespo/grip/issues/86

 @Ashesh/@Dave can you please review the patch?
 If it looks good, we can do the same changes in case of other nodes.

 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


>>>
>>
>


Re: [pgadmin-hackers] [pgAdmin4][Patch]: Regarding RM#1419 - Internal Server Error displayed if create any object through simplified Chinese character

2016-07-12 Thread Surinder Kumar
On Tue, Jul 12, 2016 at 4:07 PM, Ashesh Vashi  wrote:

> On Tue, Jul 12, 2016 at 3:58 PM, Murtuza Zabuawala <
> murtuza.zabuaw...@enterprisedb.com> wrote:
>
>> May be because of Python2.7 but if you try in Python3. It works.
>>
>> we can use PEP 0263  to fix
>> this issue.  // # -*- coding: utf-8 -*-
>>
> I tried but it didn't worked.
*It gives me error:*
Traceback (most recent call last):
  File
"/Users/surinder/Documents/Projects/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/__init__.py",
line 639, in msql
status, res = self.get_sql(gid, sid, data, did)
  File
"/Users/surinder/Documents/Projects/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/__init__.py",
line 686, in get_sql
SQL += self.get_new_sql(gid, sid, data, did)
  File
"/Users/surinder/Documents/Projects/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/__init__.py",
line 721, in get_new_sql
data=data, conn=self.conn
  File
"/Users/surinder/Documents/Workspaces/pgAdmin_27/lib/python2.7/site-packages/flask/templating.py",
line 128, in render_template
context, ctx.app)
  File
"/Users/surinder/Documents/Workspaces/pgAdmin_27/lib/python2.7/site-packages/flask/templating.py",
line 110, in _render
rv = template.render(context)
  File
"/Users/surinder/Documents/Workspaces/pgAdmin_27/lib/python2.7/site-packages/jinja2/environment.py",
line 969, in render
return self.environment.handle_exception(exc_info, True)
  File
"/Users/surinder/Documents/Workspaces/pgAdmin_27/lib/python2.7/site-packages/jinja2/environment.py",
line 742, in handle_exception
reraise(exc_type, exc_value, tb)
  File
"/Users/surinder/Documents/Projects/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/templates/databases/sql/9.3_plus/create.sql",
line 3, in top-level template code
CREATE DATABASE {{ conn|qtIdent(data.name) }}
  File
"/Users/surinder/Documents/Projects/pgadmin4/web/pgadmin/utils/driver/psycopg2/__init__.py",
line 1597, in qtIdent
val = str(val)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-8:
ordinal not in range(128)


> Isn't this about the source code encoding, and not about the input
> encoding?
>
> --
>
> 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
>>
>> On Tue, Jul 12, 2016 at 3:48 PM, Surinder Kumar <
>> surinder.ku...@enterprisedb.com> wrote:
>>
>>> On Tue, Jul 12, 2016 at 3:43 PM, Murtuza Zabuawala <
>>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>>
 Hi,

 Just a heads up, This issue is occurs only in runtime & If you try in
 web everything works fine when you provide unicode characters as object
 name.

>>> No, this issue is reported for both web and runtime application. It is
>>> reproducible to me in web application.
>>>

 Now sure but the issue is when runtime(QtWebkit) sends data it does not
 encodes it properly & this should be generic fix in runtime.

 Regards,
 Murtuza

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

 On Tue, Jul 12, 2016 at 3:27 PM, Surinder Kumar <
 surinder.ku...@enterprisedb.com> wrote:

> Hi
>
> *What is happening in code?*
> Database is created with Chinese characters successfully with ascii
> values(Chinese characters converted to ascii) before saving internally.
>
> but when database properties is retrieved by name, it fails to fetch
> data and throws UnicodeError.
>
> *Solution:*
> Database name should be encoded in 'utf-8' before storing to database.
> This resolved the issue.
> I have tested this patch by creating database name using Japanese and
> Chinese characters. It works.
>
> Also referenced the code to *set default encoding to 'uff-8' *before
> start of application.
> https://github.com/joeyespo/grip/issues/86
>
> @Ashesh/@Dave can you please review the patch?
> If it looks good, we can do the same changes in case of other nodes.
>
> 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
>
>

>>>
>>
>


Re: [pgadmin-hackers] [pgAdmin4][Patch]: Regarding RM#1419 - Internal Server Error displayed if create any object through simplified Chinese character

2016-07-12 Thread Murtuza Zabuawala
Please refer,

http://stackoverflow.com/questions/3828723/why-should-we-not-use-sys-setdefaultencodingutf-8-in-a-py-script

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

On Tue, Jul 12, 2016 at 4:18 PM, Surinder Kumar <
surinder.ku...@enterprisedb.com> wrote:

> On Tue, Jul 12, 2016 at 4:07 PM, Ashesh Vashi <
> ashesh.va...@enterprisedb.com> wrote:
>
>> On Tue, Jul 12, 2016 at 3:58 PM, Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>> May be because of Python2.7 but if you try in Python3. It works.
>>>
>>> we can use PEP 0263  to fix
>>> this issue.  // # -*- coding: utf-8 -*-
>>>
>> I tried but it didn't worked.
> *It gives me error:*
> Traceback (most recent call last):
>   File
> "/Users/surinder/Documents/Projects/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/__init__.py",
> line 639, in msql
> status, res = self.get_sql(gid, sid, data, did)
>   File
> "/Users/surinder/Documents/Projects/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/__init__.py",
> line 686, in get_sql
> SQL += self.get_new_sql(gid, sid, data, did)
>   File
> "/Users/surinder/Documents/Projects/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/__init__.py",
> line 721, in get_new_sql
> data=data, conn=self.conn
>   File
> "/Users/surinder/Documents/Workspaces/pgAdmin_27/lib/python2.7/site-packages/flask/templating.py",
> line 128, in render_template
> context, ctx.app)
>   File
> "/Users/surinder/Documents/Workspaces/pgAdmin_27/lib/python2.7/site-packages/flask/templating.py",
> line 110, in _render
> rv = template.render(context)
>   File
> "/Users/surinder/Documents/Workspaces/pgAdmin_27/lib/python2.7/site-packages/jinja2/environment.py",
> line 969, in render
> return self.environment.handle_exception(exc_info, True)
>   File
> "/Users/surinder/Documents/Workspaces/pgAdmin_27/lib/python2.7/site-packages/jinja2/environment.py",
> line 742, in handle_exception
> reraise(exc_type, exc_value, tb)
>   File
> "/Users/surinder/Documents/Projects/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/templates/databases/sql/9.3_plus/create.sql",
> line 3, in top-level template code
> CREATE DATABASE {{ conn|qtIdent(data.name) }}
>   File
> "/Users/surinder/Documents/Projects/pgadmin4/web/pgadmin/utils/driver/psycopg2/__init__.py",
> line 1597, in qtIdent
> val = str(val)
> UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-8:
> ordinal not in range(128)
>
>
>> Isn't this about the source code encoding, and not about the input
>> encoding?
>>
>> --
>>
>> 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
>>>
>>> On Tue, Jul 12, 2016 at 3:48 PM, Surinder Kumar <
>>> surinder.ku...@enterprisedb.com> wrote:
>>>
 On Tue, Jul 12, 2016 at 3:43 PM, Murtuza Zabuawala <
 murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi,
>
> Just a heads up, This issue is occurs only in runtime & If you try in
> web everything works fine when you provide unicode characters as object
> name.
>
 No, this issue is reported for both web and runtime application. It is
 reproducible to me in web application.

>
> Now sure but the issue is when runtime(QtWebkit) sends data it does
> not encodes it properly & this should be generic fix in runtime.
>
> Regards,
> Murtuza
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> On Tue, Jul 12, 2016 at 3:27 PM, Surinder Kumar <
> surinder.ku...@enterprisedb.com> wrote:
>
>> Hi
>>
>> *What is happening in code?*
>> Database is created with Chinese characters successfully with ascii
>> values(Chinese characters converted to ascii) before saving internally.
>>
>> but when database properties is retrieved by name, it fails to fetch
>> data and throws UnicodeError.
>>
>> *Solution:*
>> Database name should be encoded in 'utf-8' before storing to database.
>> This resolved the issue.
>> I have tested this patch by creating database name using Japanese and
>> Chinese characters. It works.
>>
>> Also referenced the code to *set default encoding to 'uff-8' *before
>> start of application.
>> https://github.com/joeyespo/grip/issues/86
>>
>> @Ashesh/@Dave can you please review the patch?
>> If it looks good, we can do the same changes in case of other nodes.
>>
>> Thanks,
>> Surinder Kumar
>>
>>
>>
>>
>>
>> --
>> Sent vi

[pgadmin-hackers] PATCH: Comments are not visible in Language node (pgAdmin4)

2016-07-12 Thread Murtuza Zabuawala
Hi,

PFA patch to fix RM#1412, where comments are not visible in sql pane for
Languages node.

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


RM_1421.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] pgAdmin 4 feedback

2016-07-12 Thread Dave Page
Hi

On Mon, Jul 11, 2016 at 9:18 PM, Michael Hornick <
mhorn...@insurancesystems.com> wrote:

> Hello team – great work!
>

Thanks!


> We have been using Postrgres as the main database for our insurance
> product for over 10 years, and it has been a great experience so far.
> Personally, I have been using a product called AQT to do most of my
> Postgres SQL work – mainly because of the lack of “features” offered in
> pgAdmin III.  Although, most developers in our company indeed use pgAdmin
> III.  Thankfully, it seems that some great headway is now being made.  Let
> me know if you want a list of features that I use daily on AQT that I would
> like to see in pgAdmin – I would be happy to list and explain those in
> order of usefulness.
>

Please do - you can log feature requests (and bugs) here:
https://redmine.postgresql.org/projects/pgadmin4/issues/new. Please use one
ticket per request/bug.


>
>
> *Issues:*
>
>
>
> My first issue with the new pgAdmin 4 is that the numeric fields seem to
> add commas and “.00” in the table listings.  I would need a way to turn
> this feature off before I could use pgAdmin 4.  The reason is that we use
> numeric 19,0 often as a record object ID in many fields within our over 700
> database tables.  These fields always contain 19 digits, and it seems
> impossible to easily read these fields using this new listing format.
>

Yes, I've had other complaints about that, and am inclined to just disable
numeric formatting as we did in pgAdmin 3.


>
>
>
>
> I have no idea how many testers are providing feedback.  So, please let me
> know if having another user providing feedback is useful or not.  If not, I
> will wait until the final release and take a look then.
>
>
>
> Thanks.
>
>
>
> Mike
>
>
>
> ………
>
> *Michael Hornick *
>
> *Architect* | Insurance Systems Inc. 
>
>
>
> 
>
> *T*: (416) 249-2260  *| *1-877-777-2231 Ext. 319
>
> *M*: (416) 704-9250
>
> *E:  * mhorn...@insurancesystems.com
>
> *Skype*: mhorn...@insurancesystems.com
>
> __
>
> This e-mail is intended for the person(s) to whom it is addressed and may
> contain information which is PRIVILEGED or CONFIDENTIAL. Any unauthorized
> use, distribution, copying or disclosure by any person other than the
> addressee(s) is strictly prohibited. If you have received this e-mail in
> error, please notify the sender immediately by return mail and delete the
> message and any attachments from your system.
>
>
>



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

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


Re: [pgadmin-hackers] pgAdmin IV API test cases patch

2016-07-12 Thread Dave Page
On Tue, Jul 12, 2016 at 5:14 AM, Khushboo Vashi
 wrote:
>
>
> On Mon, Jul 11, 2016 at 7:15 PM, Priyanka Shendge
>  wrote:
>>
>>
>>
>> On 11 July 2016 at 18:35, Dave Page  wrote:
>>>
>>> On Mon, Jul 11, 2016 at 1:25 PM, Priyanka Shendge
>>>  wrote:
>>> > Sorry, by mistake i copied incomplete query.  There is an OID present
>>> > for
>>> > added database.
>>> >
>>> > SELECT
>>> > db.oid as did, db.datname, db.datallowconn,
>>> > pg_encoding_to_char(db.encoding) AS serverencoding,
>>> > has_database_privilege(db.oid, 'CREATE') as cancreate,
>>> > datlastsysoid
>>> > FROM
>>> > pg_database db
>>> > WHERE db.oid = 158579
>>>
>>> There's nothing wrong with that query. Can you work with Khushboo to
>>> see if she can reproduce or help figure it out please?
>>
>>
>> I had work with Khushboo, she also tried to reproduce the issue at her
>> it's working fine for her.
>> Khushboo also tried to troubleshoot/trace the issue but not able to figure
>> out where exactly its failing;
>> as issue was not reproducible.
>>
>> @Khushboo:
>>  Please add if i am missing anything.
>>>
>>>
>
>
> We have tried to reproduce this issue at our end several times with the
> different scenarios but every attempt was unsuccessful.
>
> Here the newly created database connection is failing which should not as
> the database is created properly as per the log.
> The above query (mentioned by Priyanka) executes from the psycopg2 driver
> and could fail in 2 scenarios, either the database has been dropped before
> this particular test-case runs or the database is not created properly
> through the 'create database test-case'.  But as per the log, the 'delete
> database test-case' runs after this test-case and the database is created
> properly.
>
> Can any privilege issue prevent the database connection in this scenario?

Not on my system, that I can think of.

If there was a connection error like that though, shouldn't we see a
message from libpq at least? If not, that implies that there are error
reporting issues to be fixed.


-- 
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


Re: [pgadmin-hackers] [Patch] Fix Unicode in errmsg

2016-07-12 Thread Ashesh Vashi
On Wed, Jul 13, 2016 at 1:11 AM, Magnun Leno  wrote:

> What error are you getting?
> Can you please share the exact error message to understand the issue
> properly?
>
> Sorry, my bad. Here is the traceback:
>
> 2016-07-12 16:12:22,366: ERRORpgadmin:Exception on
> /browser/server-group/obj/ [POST]
> Traceback (most recent call last):
>   File
> "/home/magnun/venv/pgadmin4/lib/python2.7/site-packages/flask/app.py", line
> 1817, in wsgi_app
> response = self.full_dispatch_request()
>   File
> "/home/magnun/venv/pgadmin4/lib/python2.7/site-packages/flask/app.py", line
> 1477, in full_dispatch_request
> rv = self.handle_user_exception(e)
>   File
> "/home/magnun/venv/pgadmin4/lib/python2.7/site-packages/flask/app.py", line
> 1381, in handle_user_exception
> reraise(exc_type, exc_value, tb)
>   File
> "/home/magnun/venv/pgadmin4/lib/python2.7/site-packages/flask/app.py", line
> 1475, in full_dispatch_request
> rv = self.dispatch_request()
>   File
> "/home/magnun/venv/pgadmin4/lib/python2.7/site-packages/flask/app.py", line
> 1461, in dispatch_request
> return self.view_functions[rule.endpoint](**req.view_args)
>   File
> "/home/magnun/venv/pgadmin4/lib/python2.7/site-packages/flask/views.py",
> line 84, in view
> return self.dispatch_request(*args, **kwargs)
>   File
> "/home/magnun/venv/pgadmin4/lib/python2.7/site-packages/pgadmin4/pgadmin/browser/utils.py",
> line 235, in dispatch_request
> return method(*args, **kwargs)
>   File
> "/home/magnun/venv/pgadmin4/lib/python2.7/site-packages/pgadmin4/pgadmin/browser/server_groups/__init__.py",
> line 204, in create
> data = request.form if request.form else
> json.loads(request.data.decode())
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 14:
> ordinal not in range(128)
>
> How to reproduce:
>
>1. Start PgAdmin4;
>2. Access localhost:5050
>3. Login
>4. In the left panel, right click in Servers. Then, "Create > Server
>Group", or "Create > Server" (both share the same error)
>5. In the "Name field", write any non ASCII word. In my case I was
>using the following name: Produção
>6. Click "Save"
>
> More info about my env:
>
> $ env | grep LANG
> LANG=pt_BR.UTF-8
> GDM_LANG=pt_BR.UTF-8
>
> $ python --version
> Python 2.7.11
>
> $ pip freeze
> Babel==1.3
> beautifulsoup4==4.4.1
> blinker==1.3
> django-htmlmin==0.8.0
> extras==0.0.3
> fixtures==2.0.0
> Flask==0.10.1
> Flask-Babel==0.9
> Flask-Gravatar==0.4.2
> Flask-Login==0.2.11
> Flask-Mail==0.9.1
> Flask-Principal==0.4.0
> Flask-Security==1.7.4
> Flask-SQLAlchemy==2.0
> Flask-WTF==0.11
> html5lib==1.0b3
> importlib==1.0.3
> itsdangerous==0.24
> Jinja2==2.7.3
> linecache2==1.0.0
> MarkupSafe==0.23
> passlib==1.6.2
> pbr==1.9.1
> pgadmin4==1.0b2
> psycopg2==2.5.2
> pycrypto==2.6.1
> pyrsistent==0.11.13
> python-dateutil==2.5.0
> python-mimeparse==1.5.1
> pytz==2014.10
> simplejson==3.6.5
> six==1.9.0
> speaklater==1.3
> SQLAlchemy==0.9.8
> sqlparse==0.1.19
> testscenarios==0.5.0
> testtools==2.0.0
> traceback2==1.4.0
> unittest2==1.1.0
> Werkzeug==0.9.6
> WTForms==2.0.2
>
>
> We will need to change too many places by this logic.
> I've attached patch for it.
>
> I'm not familiar with the code base yet, but not necessarily all
> occurrences of "decode()" need to be patched, just the ones that deal with
> user input.
>
I've changed only the data coming as the user input for deferent nodes. :-)

>
> I've done some further testing and noticed that even running an insert or
> update with non ASCII text runs into failure.
>
I've not yet looked at the other utilities in pgAdmin IV.

I'll look in to it too, and share the updated patch.

> This "update users set cidade='Brasília' where id=1;", results in the
> following traceback:
>
> 2016-07-12 16:32:59,964: ERRORpgadmin:Exception on
> /sqleditor/query_tool/start/2760583 [POST]
> Traceback (most recent call last):
>   File
> "/home/magnun/venv/pgadmin4/lib/python2.7/site-packages/flask/app.py", line
> 1817, in wsgi_app
> response = self.full_dispatch_request()
>   File
> "/home/magnun/venv/pgadmin4/lib/python2.7/site-packages/flask/app.py", line
> 1477, in full_dispatch_request
> rv = self.handle_user_exception(e)
>   File
> "/home/magnun/venv/pgadmin4/lib/python2.7/site-packages/flask/app.py", line
> 1381, in handle_user_exception
> reraise(exc_type, exc_value, tb)
>   File
> "/home/magnun/venv/pgadmin4/lib/python2.7/site-packages/flask/app.py", line
> 1475, in full_dispatch_request
> rv = self.dispatch_request()
>   File
> "/home/magnun/venv/pgadmin4/lib/python2.7/site-packages/flask/app.py", line
> 1461, in dispatch_request
> return self.view_functions[rule.endpoint](**req.view_args)
>   File
> "/home/magnun/venv/pgadmin4/lib/python2.7/site-packages/flask_login.py",
> line 758, in decorated_view
> return func(*args, **kwargs)
>   File
> "/home/magnun/venv/pgadmin4/lib/python2.7/site-packages/pgadmin4/pgadmin/tools/sqleditor/__init__.py",
> line 

[pgadmin-hackers] Regarding issue in psycopg2 driver handling duplicate field names in query (pgAdmin4)

2016-07-12 Thread Murtuza Zabuawala
Hi,

I was looking into RM#1409 and found that it is issue with psycopg2 driver
handling DictCursor  result which is not handling duplicate field names.

I have also raised issue for the same
https://github.com/psycopg/psycopg2/issues/454


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


[pgadmin-hackers] [pgAdmin4][Patch]: Render data grid only if Dashboard Panel is active

2016-07-12 Thread Surinder Kumar
Hi

In Dashboard, the ajax calls to *render data grid* should only made, if
dashboard panel is active.
Currently it make ajax calls even if other panels like properties, sql are
active.

Please find attached patch and review.

Thanks,
Surinder Kumar


dashboard_render_if_panel_is_opened.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