pgAdmin 4 commit: Added schema-qualified dictionary names in FTS config

2020-04-16 Thread Akshay Joshi
Added schema-qualified dictionary names in FTS configuration to avoid confusion 
of duplicate names. Fixes #4709

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=7493649893c167e2923ca8a42760baa46ba9c255
Author: Ganesh Jaybhay 

Modified Files
--
docs/en_US/release_notes_4_21.rst  |   1 +
.../sql/default/dictionaries.sql   |  11 ++-
.../fts_configurations/sql/default/sql.sql |   9 +-
.../sql/default/tokenDictList.sql  |   9 +-
.../alter_fts_conf_add_token_verify_schema.sql |   8 ++
.../tests/default/create_fts_dictionary.sql|   7 ++
...msql_alter_fts_conf_add_token_verify_schema.sql |   3 +
.../tests/default/msql_create_fts_dictionary.sql   |   3 +
.../fts_configurations/tests/default/test.json |  30 +-
.../tests/test_fts_configuration_put.py| 108 +
10 files changed, 179 insertions(+), 10 deletions(-)



pgAdmin 4 commit: Ensure the DROP statements in reverse engineered SQL

2020-04-16 Thread Akshay Joshi
Ensure the DROP statements in reverse engineered SQL are properly quoted for 
all objects. Fixes #4440

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=d6cab7b421db3bae0ad4c3f6ac79cc81066a6d14
Author: Shubham Agarwal 

Modified Files
--
docs/en_US/release_notes_4_21.rst |  1 +
.../servers/databases/foreign_data_wrappers/__init__.py   | 11 +++
.../tests/pg/9.3_plus/alter_fdw_change_opt2.sql   |  2 +-
.../tests/pg/9.3_plus/alter_fdw_comment.sql   |  2 +-
.../tests/pg/9.3_plus/alter_fdw_opt1.sql  |  2 +-
.../tests/pg/9.3_plus/alter_fdw_opt2.sql  |  2 +-
.../tests/pg/9.3_plus/alter_fdw_privileges.sql|  2 +-
.../tests/pg/9.3_plus/alter_fdw_rename.sql|  2 +-
.../tests/pg/9.3_plus/alter_fdw_validator.sql |  2 +-
.../foreign_data_wrappers/tests/pg/9.3_plus/create_fdw.sql|  2 +-
.../tests/ppas/9.3_plus/alter_fdw_change_opt2.sql |  2 +-
.../tests/ppas/9.3_plus/alter_fdw_comment.sql |  2 +-
.../tests/ppas/9.3_plus/alter_fdw_opt1.sql|  2 +-
.../tests/ppas/9.3_plus/alter_fdw_opt2.sql|  2 +-
.../tests/ppas/9.3_plus/alter_fdw_privileges.sql  |  2 +-
.../tests/ppas/9.3_plus/alter_fdw_rename.sql  |  2 +-
.../tests/ppas/9.3_plus/alter_fdw_validator.sql   |  2 +-
.../foreign_data_wrappers/tests/ppas/9.3_plus/create_fdw.sql  |  2 +-
18 files changed, 24 insertions(+), 20 deletions(-)



pgAdmin 4 commit: Some minor gettext and format fixes.

2020-04-16 Thread Akshay Joshi
Some minor gettext and format fixes.

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=8254e9f030a4c951c4600378a67a62c7b0692aba
Author: Libor M 

Modified Files
--
.../server_groups/servers/databases/event_triggers/__init__.py| 2 +-
.../databases/schemas/tables/constraints/index_constraint/__init__.py | 2 +-
web/pgadmin/browser/server_groups/servers/static/js/server.js | 2 +-
web/pgadmin/misc/file_manager/__init__.py | 4 ++--
4 files changed, 5 insertions(+), 5 deletions(-)



pgAdmin 4 commit: Ensure that Constraint Trigger, Deferrable, Deferred

2020-04-16 Thread Akshay Joshi
Ensure that Constraint Trigger, Deferrable, Deferred option should be disabled 
when the user selects EDB-SPL function for the trigger. Fixes #4957

Branch
--
master

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

Modified Files
--
docs/en_US/release_notes_4_21.rst  | 1 +
.../servers/databases/schemas/tables/triggers/static/js/trigger.js | 7 ++-
2 files changed, 7 insertions(+), 1 deletion(-)



pgAdmin 4 commit: Fixed an issue where the Mode cell of argument grid d

2020-04-16 Thread Akshay Joshi
Fixed an issue where the Mode cell of argument grid does not appear completely 
in the Functions dialog. Fixes #5375

Branch
--
master

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

Modified Files
--
docs/en_US/images/function_definition.png  | Bin 63221 -> 74263 bytes
docs/en_US/images/procedure_arguments.png  | Bin 38440 -> 0 bytes
docs/en_US/images/procedure_definition.png | Bin 42650 -> 79101 bytes
docs/en_US/procedure_dialog.rst|  35 +
docs/en_US/release_notes_4_21.rst  |   1 +
.../schemas/functions/static/js/function.js|   3 ++
6 files changed, 19 insertions(+), 20 deletions(-)



Re: [pgAdmin4][RM#5375] "Mode" cell does not appear completely in the function dialog (Firefox specific issue)

2020-04-16 Thread Akshay Joshi
Thanks, patch applied.

On Wed, Apr 15, 2020 at 4:29 PM Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hi,
>
> PFA patch to fix the issue where the Mode cell from arguments grid does
> not appear completely in the Functions dialog.
>
>
> --
> Regards,
> Murtuza Zabuawala
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>

-- 
*Thanks & Regards*
*Akshay Joshi*

*Sr. Software Architect*
*EnterpriseDB Software India Private Limited*
*Mobile: +91 976-788-8246*


Re: [pgAdmin4 Patch - RM 4440]

2020-04-16 Thread Akshay Joshi
Thanks, patch applied.

On Wed, Apr 15, 2020 at 4:37 PM Shubham Agarwal <
shubham.agar...@enterprisedb.com> wrote:

>
>
> On Wed, Apr 15, 2020 at 4:31 PM Khushboo Vashi <
> khushboo.va...@enterprisedb.com> wrote:
>
>>
>>
>> On Wed, Apr 15, 2020 at 4:29 PM Shubham Agarwal <
>> shubham.agar...@enterprisedb.com> wrote:
>>
>>> Hi Team,
>>> PFA patch containing the fix and the resql test cases.
>>>
>>> You forgot to attach the patch.
>>
>>> --
>>> Thanks & Regards,
>>> Shubham Agarwal
>>> EnterpriseDB Corporation
>>>
>>> The Postgres Database Company
>>>
>>
>
> --
> Thanks & Regards,
> Shubham Agarwal
> EnterpriseDB Corporation
>
> The Postgres Database Company
>


-- 
*Thanks & Regards*
*Akshay Joshi*

*Sr. Software Architect*
*EnterpriseDB Software India Private Limited*
*Mobile: +91 976-788-8246*


Re: [pgAdmin4][Patch] - RM 4957 - Constraint Trigger, Deferrable, Deferred option should be disbled if user select EDB-SPL function for trigger for EPAS.

2020-04-16 Thread Akshay Joshi
Thanks, patch applied.

On Wed, Apr 15, 2020 at 4:54 PM Khushboo Vashi <
khushboo.va...@enterprisedb.com> wrote:

> Hi Akshay,
>
> Please find the attached updated patch.
>
> Thanks,
> Khushboo
>
> On Wed, Apr 15, 2020 at 3:58 PM Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
>
>> Hi Khushboo
>>
>> The fix is not correct, as per RM, we should disable Constraint Trigger,
>> Deferrable, Deferred option when the user selects the "Inline EDB-SPL"
>> function.
>> With this patch, it is disabled for EPAS. Please fix and resend the patch.
>>
>> On Wed, Apr 15, 2020 at 12:06 PM Khushboo Vashi <
>> khushboo.va...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> Please find the attached small patch to fix the issue #4957 - Constraint
>>> Trigger, Deferrable, Deferred option should be disbled if user select
>>> EDB-SPL function for trigger for EPAS.
>>>
>>> Thanks,
>>> Khushboo
>>>
>>>
>>
>> --
>> *Thanks & Regards*
>> *Akshay Joshi*
>>
>> *Sr. Software Architect*
>> *EnterpriseDB Software India Private Limited*
>> *Mobile: +91 976-788-8246*
>>
>

-- 
*Thanks & Regards*
*Akshay Joshi*

*Sr. Software Architect*
*EnterpriseDB Software India Private Limited*
*Mobile: +91 976-788-8246*


Re: pgAdmin 4 - next gettext usage fixes

2020-04-16 Thread Akshay Joshi
Thanks, patch applied.

On Wed, Apr 15, 2020 at 5:17 PM Libor M.  wrote:

> Hi,
> next minor gettext and format fixes in patch.
>
> Best regards,
>
> Libor M.
>
> E-mail: libor...@gmail.com
> GitHub: https://github.com/liborm85
>
> st 15. 4. 2020 v 13:17 odesílatel Akshay Joshi
>  napsal:
> >
> > Thanks, patch applied.
> >
> > On Wed, Apr 15, 2020 at 2:55 PM Aditya Toshniwal <
> aditya.toshni...@enterprisedb.com> wrote:
> >>
> >> Hi,
> >>
> >> Please find the updated patch.
> >>
> >> On Wed, Apr 15, 2020 at 1:33 PM Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
> >>>
> >>> Hi Aditya
> >>>
> >>> I think the fix is incorrect. .format method should be applied after
> gettext() like gettext().format(). Please check for other places too and
> send the updated patch.
> >>>
> >>> On Wed, Apr 15, 2020 at 11:38 AM Aditya Toshniwal <
> aditya.toshni...@enterprisedb.com> wrote:
> 
>  Hi Hackers/Libor,
> 
>  The changes like below are incorrect. Try "Count rows" from a table's
> context menu.
> 
>  -info=gettext("Table rows counted: %s" % count),
> 
>  +info=gettext("Table rows counted: %s") % count,
> 
> 
>  Attached is the patch to fix all such changes in pgAdmin, to use
> format() instead.
>  Please review.
> 
>  On Fri, Apr 10, 2020 at 2:57 PM Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
> >
> > Hi Libor
> >
> > Thanks, patch applied. Please make sure to run the PEP8 checks
> before sending the patch.
> > I have fixed and committed the code.
> >
> > On Wed, Apr 8, 2020 at 9:30 PM Libor M.  wrote:
> >>
> >> Hello,
> >> I fixed next gettext usage:
> >>
> >> - fixed gettext usage with .format() only for original text with %s
> >> - fixed typos
> >> - fixed translation yes/no buttons in dialog
> >> - improved translating sentences without "connecting" words (eg. see
> >> web/pgadmin/dashboard/static/js/dashboard.js, word 'cancel' needs to
> >> be translated in Czech language as 'zrušit' but in another sentence
> as
> >> 'zrušení')
> >> - added gettext for text translations
> >>
> >> Diff file is attached.
> >>
> >> Best regards,
> >>
> >> Libor M.
> >>
> >> E-mail: libor...@gmail.com
> >> GitHub: https://github.com/liborm85
> >
> >
> >
> > --
> > Thanks & Regards
> > Akshay Joshi
> > Sr. Software Architect
> > EnterpriseDB Software India Private Limited
> > Mobile: +91 976-788-8246
> 
> 
> 
>  --
>  Thanks and Regards,
>  Aditya Toshniwal
>  pgAdmin Hacker | Sr. Software Engineer | EnterpriseDB India | Pune
>  "Don't Complain about Heat, Plant a TREE"
> >>>
> >>>
> >>>
> >>> --
> >>> Thanks & Regards
> >>> Akshay Joshi
> >>> Sr. Software Architect
> >>> EnterpriseDB Software India Private Limited
> >>> Mobile: +91 976-788-8246
> >>
> >>
> >>
> >> --
> >> Thanks and Regards,
> >> Aditya Toshniwal
> >> pgAdmin Hacker | Sr. Software Engineer | EnterpriseDB India | Pune
> >> "Don't Complain about Heat, Plant a TREE"
> >
> >
> >
> > --
> > Thanks & Regards
> > Akshay Joshi
> > Sr. Software Architect
> > EnterpriseDB Software India Private Limited
> > Mobile: +91 976-788-8246
>


-- 
*Thanks & Regards*
*Akshay Joshi*

*Sr. Software Architect*
*EnterpriseDB Software India Private Limited*
*Mobile: +91 976-788-8246*


pgAdmin 4 commit: Fixed documentation error.

2020-04-16 Thread Akshay Joshi
Fixed documentation error.

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=0dd1cb3fc162c694fc644c3317a52396cdc54199

Modified Files
--
docs/en_US/procedure_dialog.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



Re: [pgAdmin][RM5210] pgAdmin4 silently truncates text larger than underlying field size

2020-04-16 Thread Khushboo Vashi
Hi,

Patch looks good to me.

Thanks,
Khushboo

On Thu, Apr 16, 2020 at 12:07 PM navnath gadakh <
navnath.gad...@enterprisedb.com> wrote:

> Hi Khushboo,
>
>  Please find the modified patch. I have removed the length from the data
> types. Test cases also passing on all Postgres versions.
> Thanks!
>
>
>
> On Wed, Apr 15, 2020 at 6:22 PM Ashesh Vashi <
> ashesh.va...@enterprisedb.com> wrote:
>
>>
>>
>> On Wed, 15 Apr 2020 at 18:21, Ashesh Vashi 
>> wrote:
>>
>>>
>>>
>>> On Wed, 15 Apr 2020 at 18:18, Murtuza Zabuawala <
>>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>>
 Hello,

 We are sending the data to backend and depending on errors from
 backend. Any thoughts on implementation of basic fronted validations?
 so that we can alert user before it clicks on save button.

>>> We should not try to implement the database functionality in JavaScript.
>>> One of the important reason for the same, we would never be able to
>>> understand each and every types supported by PG/PEM.
>>>
>> and - types from custom extensions.
>> So - no to that.
>>
>> — Ashesh
>>
>>>
>>> — Ashesh
>>>
>>>

 On Wed, 15 Apr 2020, 18:08 Dave Page, 
 wrote:

> Removing the typecast will almost certainly lead to other problems. I
> think we should just remove the length from it.
>
> On Wed, Apr 15, 2020 at 1:33 PM navnath gadakh <
> navnath.gad...@enterprisedb.com> wrote:
>
>> @Dave Page   @Akshay Joshi
>>  your input please?
>>
>> On Wed, Apr 15, 2020 at 3:13 PM Neel Patel <
>> neel.pa...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> I think we should remove the type cast from query during update and
>>> whatever error is thrown should be shown to UI as per scenario 3.
>>>
>>> Thanks,
>>> Neel Patel
>>>
>>> On Wed, Apr 15, 2020 at 3:06 PM Khushboo Vashi <
>>> khushboo.va...@enterprisedb.com> wrote:
>>>


 On Wed, Apr 15, 2020 at 2:48 PM navnath gadakh <
 navnath.gad...@enterprisedb.com> wrote:

> Hello Hackers,
>
>
> On Tue, Apr 14, 2020 at 5:14 PM Khushboo Vashi <
> khushboo.va...@enterprisedb.com> wrote:
>
>> Hi Navnath,
>>
>> You have compared the column's internal size with the length of
>> the value given by the user.
>> For example, column having integer would have internal size 4 and
>> if I give the value 12121 which is the correct input for the field 
>> will
>> fail here because as per your logic column internal size (4) < 
>> len(value)
>> (5).
>>
>> I think this implementation is not correct here.
>>
> Yes, my implementations might be wrong.
>
> Below are some important findings on the parameterised query(as we
> are using Jinja templates for building SQL queries).
> Here I have created a table 'account' with some records in it.
> CREATE TABLE public.account
> (
> user_id integer NOT NULL,
> username character varying(5)
> )
>
> psycopg2 throws a proper error if I pass username value greater
> than the length of the data type(5)
> Now, I want to pass username value greater than data type length
> (5)
>
> Scenario 1:  Query with data type and length
>
> import psycopg2
> try:
> conn = psycopg2.connect("dbname='postgres' user='postgres' 
> host='XXX.XXX.XXX.XXX' password='test' port=5432")
> cur = conn.cursor()
> cur.execute("UPDATE public.account SET username = 
> %(username)s::character varying(5) WHERE user_id = 1;", {"username": 
> "username-test-123"})
> cur.execute("COMMIT;")
> except Exception as e:
> print('Exception : {0}'.format(e))
>
> *Output:*
>
> It will save the record with 5 char data without any error.
>
> *psql output:*
>
> postgres=# select * from public.account;
>  user_id | username
> -+--
>1 | usern
> (1 row)
>
> Scenario 2:  Query with only data type
>
> import psycopg2
> try:
> conn = psycopg2.connect("dbname='postgres' user='postgres' 
> host='XXX.XXX.XXX.XXX' password='test' port=5432")
> cur = conn.cursor()
> cur.execute("UPDATE public.account SET username = 
> %(username)s::character varying WHERE user_id = 1;", {"username": 
> "username-test-123"})
> cur.execute("COMMIT;")
> except Exception as e:
> print('Exception : {0}'.format(e))
>
> *Output:*
>
> Exception : value too long for type character varying(5)
>
> data will not save in th

Re: [pgAdmin 4 - Housekeeping #5255] Implement Selenium Grid using multi-threading & solenoid using current test framework

2020-04-16 Thread navnath gadakh
Hi,
I think I am not the right person to review this patch now as I already
reviewed this code offline in the last week. I know the approached Yogesh
has followed, also given some review comments on it.
Someone else please review it.

Thanks!

On Mon, Apr 13, 2020 at 2:49 PM Akshay Joshi 
wrote:

> Hi Navnath
>
> Can you please review it?
>
> On Mon, Apr 13, 2020 at 2:40 PM Yogesh Mahajan <
> yogesh.maha...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> Please find the attached patch for running *features tests* using
>> solenoid(selenium grid + docker).
>> KIndly review.
>> To sun feature tests in parallel, required prerequisites can be checked
>> in '~/web/regression/README' file.
>> Also detailed instructions are added in the same file.
>> After applying the patch, any existing process for execution of
>> API/Features tests remains the same.
>>
>>
>> Thanks,
>> Yogesh Mahajan
>> QA - Team
>> EnterpriseDB Corporation
>>
>> Phone: +91-9741705709
>>
>
>
> --
> *Thanks & Regards*
> *Akshay Joshi*
>
> *Sr. Software Architect*
> *EnterpriseDB Software India Private Limited*
> *Mobile: +91 976-788-8246*
>


-- 
Regards,
Navnath Gadakh


pgAdmin 4 commit: Fixed copy-paste row issues in View/Edit Data. Fixes

2020-04-16 Thread Akshay Joshi
Fixed copy-paste row issues in View/Edit Data. Fixes #3947
  1) Copy table rows across two or more active query tool sessions.
  2) Copied rows can be pasted multiple times without selecting a row in the 
query tool grid.
  3) Adds an empty row at the end in the query tool grid after pasting rows.

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=0ce4f49e082418128cb16e5c8b8ed644afc1836c
Author: Nagesh Dhope 

Modified Files
--
docs/en_US/release_notes_4_21.rst  |  1 +
web/pgadmin/static/js/selection/clipboard.js   |  6 ++
web/pgadmin/static/js/selection/copy_data.js   |  4 ++
web/pgadmin/tools/sqleditor/static/js/sqleditor.js | 72 ++
4 files changed, 56 insertions(+), 27 deletions(-)



Re: [pgAdmin][RM5210] pgAdmin4 silently truncates text larger than underlying field size

2020-04-16 Thread Akshay Joshi
Thanks, patch applied.

On Thu, Apr 16, 2020 at 1:53 PM Khushboo Vashi <
khushboo.va...@enterprisedb.com> wrote:

> Hi,
>
> Patch looks good to me.
>
> Thanks,
> Khushboo
>
> On Thu, Apr 16, 2020 at 12:07 PM navnath gadakh <
> navnath.gad...@enterprisedb.com> wrote:
>
>> Hi Khushboo,
>>
>>  Please find the modified patch. I have removed the length from the data
>> types. Test cases also passing on all Postgres versions.
>> Thanks!
>>
>>
>>
>> On Wed, Apr 15, 2020 at 6:22 PM Ashesh Vashi <
>> ashesh.va...@enterprisedb.com> wrote:
>>
>>>
>>>
>>> On Wed, 15 Apr 2020 at 18:21, Ashesh Vashi <
>>> ashesh.va...@enterprisedb.com> wrote:
>>>


 On Wed, 15 Apr 2020 at 18:18, Murtuza Zabuawala <
 murtuza.zabuaw...@enterprisedb.com> wrote:

> Hello,
>
> We are sending the data to backend and depending on errors from
> backend. Any thoughts on implementation of basic fronted validations?
> so that we can alert user before it clicks on save button.
>
 We should not try to implement the database functionality in
 JavaScript. One of the important reason for the same, we would never be
 able to understand each and every types supported by PG/PEM.

>>> and - types from custom extensions.
>>> So - no to that.
>>>
>>> — Ashesh
>>>

 — Ashesh


>
> On Wed, 15 Apr 2020, 18:08 Dave Page, 
> wrote:
>
>> Removing the typecast will almost certainly lead to other problems. I
>> think we should just remove the length from it.
>>
>> On Wed, Apr 15, 2020 at 1:33 PM navnath gadakh <
>> navnath.gad...@enterprisedb.com> wrote:
>>
>>> @Dave Page   @Akshay Joshi
>>>  your input please?
>>>
>>> On Wed, Apr 15, 2020 at 3:13 PM Neel Patel <
>>> neel.pa...@enterprisedb.com> wrote:
>>>
 Hi,

 I think we should remove the type cast from query during update and
 whatever error is thrown should be shown to UI as per scenario 3.

 Thanks,
 Neel Patel

 On Wed, Apr 15, 2020 at 3:06 PM Khushboo Vashi <
 khushboo.va...@enterprisedb.com> wrote:

>
>
> On Wed, Apr 15, 2020 at 2:48 PM navnath gadakh <
> navnath.gad...@enterprisedb.com> wrote:
>
>> Hello Hackers,
>>
>>
>> On Tue, Apr 14, 2020 at 5:14 PM Khushboo Vashi <
>> khushboo.va...@enterprisedb.com> wrote:
>>
>>> Hi Navnath,
>>>
>>> You have compared the column's internal size with the length of
>>> the value given by the user.
>>> For example, column having integer would have internal size 4
>>> and if I give the value 12121 which is the correct input for the 
>>> field will
>>> fail here because as per your logic column internal size (4) < 
>>> len(value)
>>> (5).
>>>
>>> I think this implementation is not correct here.
>>>
>> Yes, my implementations might be wrong.
>>
>> Below are some important findings on the parameterised query(as
>> we are using Jinja templates for building SQL queries).
>> Here I have created a table 'account' with some records in it.
>> CREATE TABLE public.account
>> (
>> user_id integer NOT NULL,
>> username character varying(5)
>> )
>>
>> psycopg2 throws a proper error if I pass username value greater
>> than the length of the data type(5)
>> Now, I want to pass username value greater than data type length
>> (5)
>>
>> Scenario 1:  Query with data type and length
>>
>> import psycopg2
>> try:
>> conn = psycopg2.connect("dbname='postgres' user='postgres' 
>> host='XXX.XXX.XXX.XXX' password='test' port=5432")
>> cur = conn.cursor()
>> cur.execute("UPDATE public.account SET username = 
>> %(username)s::character varying(5) WHERE user_id = 1;", {"username": 
>> "username-test-123"})
>> cur.execute("COMMIT;")
>> except Exception as e:
>> print('Exception : {0}'.format(e))
>>
>> *Output:*
>>
>> It will save the record with 5 char data without any error.
>>
>> *psql output:*
>>
>> postgres=# select * from public.account;
>>  user_id | username
>> -+--
>>1 | usern
>> (1 row)
>>
>> Scenario 2:  Query with only data type
>>
>> import psycopg2
>> try:
>> conn = psycopg2.connect("dbname='postgres' user='postgres' 
>> host='XXX.XXX.XXX.XXX' password='test' port=5432")
>> cur = conn.cursor()
>> cur.execute("UPDATE public.account SET username = 
>> %(username)s::character varying WHERE user_id = 1;", {"username":

pgAdmin 4 commit: Fixed internal server error when the database server

2020-04-16 Thread Akshay Joshi
Fixed internal server error when the database server is logged in with 
non-super user. Fixes #5400

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=dc1e32a632353d6e39652b4b25ea020ac0534ee9
Author: Aditya Toshniwal 

Modified Files
--
docs/en_US/release_notes_4_21.rst|  3 ++-
.../foreign_servers/sql/default/dependents.sql   | 12 +++-
.../user_mappings/sql/default/properties.sql | 20 +---
.../static/js/search_objects_dialog_wrapper.js   |  8 ++--
.../search_objects/sql/pg/10_plus/search.sql |  4 ++--
.../search_objects/sql/pg/11_plus/search.sql |  4 ++--
.../search_objects/sql/pg/default/search.sql |  4 ++--
.../search_objects/sql/ppas/10_plus/search.sql   |  4 ++--
.../search_objects/sql/ppas/12_plus/search.sql   |  4 ++--
.../search_objects/sql/ppas/default/search.sql   |  4 ++--
10 files changed, 28 insertions(+), 39 deletions(-)



pgAdmin 4 commit: Ensure that text larger than underlying field size sh

2020-04-16 Thread Akshay Joshi
Ensure that text larger than underlying field size should not be truncated 
automatically. Fixes #5210

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=c0a2f1f24dfde8272dca4ff77eda25cad28b3ea8
Author: navnath gadakh 

Modified Files
--
docs/en_US/release_notes_4_21.rst  |  1 +
web/pgadmin/tools/sqleditor/__init__.py| 19 -
.../utils/tests/test_save_changed_data.py  | 98 +-
3 files changed, 98 insertions(+), 20 deletions(-)



Re: [pgAdmin][RM3947] Fixes related rows copy-paste in Query Tool.

2020-04-16 Thread Akshay Joshi
Thanks, patch applied.

On Wed, Apr 15, 2020 at 1:39 PM Nagesh Dhope 
wrote:

> Please find an updated patch, which handles field separator and quote
> character from *Result Grid *preferences.
>
> On Wed, Apr 15, 2020 at 10:18 AM Nagesh Dhope <
> nagesh.dh...@enterprisedb.com> wrote:
>
>> Hi Hackers,
>> Please find a patch which fixes,
>>
>>1. Copy table rows across two or more active query tool sessions.
>>2. Copied rows can be pasted multiple times without selecting a row
>>in the query tool grid.
>>3. Adds an empty row at the end in the query tool grid after pasting
>>rows.
>>
>> --
>> Thanks,
>> Nagesh
>>
>
>
> --
> Thanks,
> Nagesh
>


-- 
*Thanks & Regards*
*Akshay Joshi*

*Sr. Software Architect*
*EnterpriseDB Software India Private Limited*
*Mobile: +91 976-788-8246*


Re: [pgAdmin][RM5400] An unexpected occurred: INTERNAL SERVER ERROR message displayed if database server connected with non super user

2020-04-16 Thread Akshay Joshi
Thanks, patch applied.

On Thu, Apr 16, 2020 at 11:33 AM Aditya Toshniwal <
aditya.toshni...@enterprisedb.com> wrote:

> Hi Hackers,
>
> Attached is the patch to replace the usage of pg_user_mapping table with
> pg_user_mappings view. pg_user_mapping is not publicly accessible.
> Changes are done for search objects and foreign data wrappers.
> pgAdmin throws an exception when accessing User mappings with non
> privileged users.
> More about pg_user_mappings -
> https://www.postgresql.org/docs/9.5/view-pg-user-mappings.html
>
> Please review.
>
> --
> Thanks and Regards,
> Aditya Toshniwal
> pgAdmin Hacker | Sr. Software Engineer | EnterpriseDB India | Pune
> "Don't Complain about Heat, Plant a TREE"
>


-- 
*Thanks & Regards*
*Akshay Joshi*

*Sr. Software Architect*
*EnterpriseDB Software India Private Limited*
*Mobile: +91 976-788-8246*


[pgAdmin][RM5157] Default sort order at start in view table data by primary key by default

2020-04-16 Thread navnath gadakh
Hi Dave/Team,
  This patch is related to the default sort order for the view
table data. In pgAdminIII default ordering is by primary key and this is
not working in pgAdminIV.
I have attached the patch with the back end code.

Please review it.

*Question*: There is one suggestion on
https://redmine.postgresql.org/issues/5157 about to put a checkbox in the
configuration for this behavior.
  Do I need to implement that really? I yes, Is preferences
a good place for that? / Suggestions?

Thanks!

-- 
Regards,
Navnath Gadakh


RM-5157_v1.patch
Description: Binary data


[pgAdmin][RM4573] Download csv as .csv when delimeter set comma(,)

2020-04-16 Thread Nagesh Dhope
Hi Hackers,
This patch allows user to download CSV as a '.csv' file if
delimiter character is set to comma(,) else it will download it as '.txt'
file.

This patch also contains test cases for some missing scenarios for download
CSV API.

 --
Thanks,
Nagesh


RM4573.patch
Description: Binary data


Re: [pgAdmin][RM5157] Default sort order at start in view table data by primary key by default

2020-04-16 Thread Khushboo Vashi
Hi Navnath,

On Thu, Apr 16, 2020 at 4:38 PM navnath gadakh <
navnath.gad...@enterprisedb.com> wrote:

> Hi Dave/Team,
>   This patch is related to the default sort order for the view
> table data. In pgAdminIII default ordering is by primary key and this is
> not working in pgAdminIV.
> I have attached the patch with the back end code.
>
> Please review it.
>
> *Question*: There is one suggestion on
> https://redmine.postgresql.org/issues/5157 about to put a checkbox in the
> configuration for this behavior.
>   Do I need to implement that really? I yes, Is
> preferences a good place for that? / Suggestions?
>
> I don't think we should have any configuration option for this as users
can change/delete the sorting order by using sort/filter dialog.
Also, please check this patch with the tables without Primary key, it might
fail.

Thanks,
Khushboo

> Thanks!
>
> --
> Regards,
> Navnath Gadakh
>


Re: [pgAdmin][RM5157] Default sort order at start in view table data by primary key by default

2020-04-16 Thread Dave Page
On Thu, Apr 16, 2020 at 12:08 PM navnath gadakh <
navnath.gad...@enterprisedb.com> wrote:

> Hi Dave/Team,
>   This patch is related to the default sort order for the view
> table data. In pgAdminIII default ordering is by primary key and this is
> not working in pgAdminIV.
> I have attached the patch with the back end code.
>
> Please review it.
>
> *Question*: There is one suggestion on
> https://redmine.postgresql.org/issues/5157 about to put a checkbox in the
> configuration for this behavior.
>   Do I need to implement that really? I yes, Is
> preferences a good place for that? / Suggestions?
>

I think we should make this optional, and yes, Preferences is a good place.
The reason is that sorting data is not without cost - at the very least it
will require use of an index to access what may be the whole table.

-- 
Dave Page
VP & Chief Architect, Database Infrastructure
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake


[pgAdmin4][RM#3495] Do not check for binary content if BOM marker is present in the file

2020-04-16 Thread Murtuza Zabuawala
Hi,

PFA patch to fix the issue where the user was not able to load the file in
the Query tool which contains the BOM marker, The sample file with BOM
marker is already attached in the RM.


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


RM_3495.diff
Description: Binary data