pgAdmin 4 commit: Fixed binary path issue on Windows platform. refs #53

2021-06-14 Thread Akshay Joshi
Fixed binary path issue on Windows platform. refs #5370

Branch
--
master

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

Modified Files
--
web/pgadmin/misc/__init__.py  | 6 ++
web/pgadmin/utils/__init__.py | 5 ++---
2 files changed, 4 insertions(+), 7 deletions(-)



[pgAdmin][RM-6469]: Role node: Calender control is not disabled in properties panel

2021-06-14 Thread Nikhil Mohite
Hi Hackers,

Please find the attached patch for RM-6469
:  Role node: Calender control
is not disabled in properties panel.


-- 
*Thanks & Regards,*
*Nikhil Mohite*
*Software Engineer.*
*EDB Postgres* 
*Mob.No: +91-7798364578.*


RM_6469.patch
Description: Binary data


Re: [pgAdmin][RM6520]: pgAdmin4 v 5.3 text export error

2021-06-14 Thread Pradip Parkale
Hi Aditya and Akshay,

Please find the updated patch. I have changed the variable name "data" to
'numeric_cols'.

On Fri, Jun 11, 2021 at 7:38 PM Aditya Toshniwal <
aditya.toshni...@enterprisedb.com> wrote:

> Hi Pradip,
>
> Just did a go through to your patch.
> The variable "data" which you've formed, will be computed for every row
> even though columns won't change. You should move it up and pass it to gen
> directly. This will save repeated computations.
> Secondly, it should not be named as data. It can be like - numeric_cols or
> numeric_keys.
>
> On Fri, Jun 11, 2021 at 7:17 PM Pradip Parkale <
> pradip.park...@enterprisedb.com> wrote:
>
>> Hi Hackers,
>>
>> Please find the attached patch for #6520.Added check to typecast the
>> numeric data while downloading the data in CSV format.
>>
>> --
>> Thanks & Regards,
>> Pradip Parkale
>> Software Engineer | EnterpriseDB Corporation
>>
>
>
> --
> Thanks,
> Aditya Toshniwal
> pgAdmin hacker | Sr. Software Engineer | *edbpostgres.com*
> 
> "Don't Complain about Heat, Plant a TREE"
>


-- 
Thanks & Regards,
Pradip Parkale
Software Engineer | EnterpriseDB Corporation


RM6520_v2.patch
Description: Binary data


Re: [pgAdmin][RM-2341]: Add menu option for starting PSQL

2021-06-14 Thread Nikhil Mohite
Hi Akshay,

Please find the updated patch for psql, Updated invalid command logic added
3 more commands in it.
1. \copy or \COPY
2. \e or \E
3. \ef or \EF

Now user can't execute these commands if allow shell commands is set to
False.

If required any changes please let me know.

Regards,
Nikhil Mohite

On Mon, Jun 14, 2021 at 11:48 AM Akshay Joshi 
wrote:

> Thanks, the patch applied.
>
> On Mon, Jun 14, 2021 at 10:55 AM Nikhil Mohite <
> nikhil.moh...@enterprisedb.com> wrote:
>
>> Hi Team,
>>
>> PFA patch v8
>>
>> On Mon, Jun 14, 2021 at 10:25 AM Nikhil Mohite <
>> nikhil.moh...@enterprisedb.com> wrote:
>>
>>> Hi Team,
>>>
>>> Please find the updated patch for the PSQL tool, Added check if the
>>> Windows version is not supporting the ConPty or WinPty disable the PSQL for
>>> that version. (PSQL option will not visible to the user).
>>>
>>> I have raised the issue with "pywinpty"
>>> https://github.com/spyder-ide/pywinpty/issues/161
>>>
>>> Regards,
>>> Nikhil Mohite
>>>
>>> On Fri, Jun 11, 2021 at 6:25 PM Dave Page  wrote:
>>>
 Hi

 On Fri, Jun 11, 2021 at 1:45 PM Fahar Abbas <
 fahar.ab...@enterprisedb.com> wrote:

> Hi Dave,
>
> On Fri, Jun 11, 2021 at 1:39 PM Dave Page  wrote:
>
>>
>>
>> On Fri, Jun 11, 2021 at 9:35 AM Fahar Abbas <
>> fahar.ab...@enterprisedb.com> wrote:
>>
>>> Sure Dave, I will create a new VM with the latest iso.
>>>
>>
>> Not the latest. 1809 please. And if that doesn't work, 1909. We need
>> to understand exactly what versions work and which don't.
>>
>> pgadmin4 is working fine on Windows 10 x64(1809).
>

 Great, thanks!


>
> Do I also need to test pgadmin4 on 1909  iso?
>

 I don't think so. I'm 99% certain that what we're seeing is that it
 works on the versions of Windows that support conpty, but not the older
 ones where the pywinpty library is *supposed* to fall back to using winpty.

 Hopefully Nikhil can get to the bottom of the problem with the
 pywinpty folks.



>
>>
>>> Nikhil is not able to reproduce the issue on Windows 10 with the
>>> latest version. So the issue is reproducible with older versions.
>>>
>>> Kind Regards,
>>> On Fri, Jun 11, 2021 at 1:28 PM Dave Page  wrote:
>>>


 On Fri, Jun 11, 2021 at 9:25 AM Fahar Abbas <
 fahar.ab...@enterprisedb.com> wrote:

> Windows 10 Enterprise 2016 LTSB.
>

 Hmm, I assume that is version 1607. Can you test with 1809 please?
 And if that doesn't work, try 1909.


>
> On Fri, Jun 11, 2021 at 1:12 PM Dave Page 
> wrote:
>
>> Hi
>>
>> On Fri, Jun 11, 2021 at 7:44 AM Fahar Abbas <
>> fahar.ab...@enterprisedb.com> wrote:
>>
>>> Hi,
>>>
>>> pgadmin4 is failing on following operating systems :
>>> Windows 2016
>>> Windows 2012
>>> Windows 07
>>> Windows 2008R2
>>> Windows 10 64
>>>
>>
>> What version of Windows 10? I *think* conpty was introduced in
>> 1809.
>>
>>
>>>
>>> pgadmin4 is working fine in following operating system:
>>> Windows 2019
>>>
>>> On Thu, Jun 10, 2021 at 7:51 PM Dave Page 
>>> wrote:
>>>


 On Thu, Jun 10, 2021 at 2:22 PM Nikhil Mohite <
 nikhil.moh...@enterprisedb.com> wrote:

> Hi Dave,
>
> On Thu, Jun 10, 2021 at 6:37 PM Dave Page 
> wrote:
>
>> Hi
>>
>> On Thu, Jun 10, 2021 at 2:00 PM Nikhil Mohite <
>> nikhil.moh...@enterprisedb.com> wrote:
>>
>>> Hi Dave,
>>>
>>> On Thu, Jun 10, 2021 at 5:22 PM Dave Page 
>>> wrote:
>>>
 Hi

 On Thu, Jun 10, 2021 at 11:08 AM Nikhil Mohite <
 nikhil.moh...@enterprisedb.com> wrote:

> Hi Dave/ Team,
>
> We are facing an issue with winpty.dll on Windows server
> 2016 and Windows 7(these are platforms on which we have 
> tested).
> Files required for winpty are present in the site-packages
> but still, it is unable to load the winpty.dll file on these 
> specific
> platforms. We have tested it on Windows 10 pro and Windows 
> server 2019 and
> it is working fine. (Also tried building the local pywinpty 
> but unable to
> build it.)  ref link for winPty
> https://github.com/rprichard/winpty#:~:text=winpty%20is%20a%20Windows%

Re: [pgAdmin][RM-2341]: Add menu option for starting PSQL

2021-06-14 Thread Dave Page
Hi

On Mon, Jun 14, 2021 at 2:13 PM Nikhil Mohite <
nikhil.moh...@enterprisedb.com> wrote:

> Hi Akshay,
>
> Please find the updated patch for psql, Updated invalid command logic
> added 3 more commands in it.
> 1. \copy or \COPY
> 2. \e or \E
> 3. \ef or \EF
>

Should they just be case insensitive?


>
> Now user can't execute these commands if allow shell commands is set to
> False.
>

What about \lo_import and \lo_export? I think those are potentially
dangerous too. Also, \echo.


>
> If required any changes please let me know.
>
> Regards,
> Nikhil Mohite
>
> On Mon, Jun 14, 2021 at 11:48 AM Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
>
>> Thanks, the patch applied.
>>
>> On Mon, Jun 14, 2021 at 10:55 AM Nikhil Mohite <
>> nikhil.moh...@enterprisedb.com> wrote:
>>
>>> Hi Team,
>>>
>>> PFA patch v8
>>>
>>> On Mon, Jun 14, 2021 at 10:25 AM Nikhil Mohite <
>>> nikhil.moh...@enterprisedb.com> wrote:
>>>
 Hi Team,

 Please find the updated patch for the PSQL tool, Added check if the
 Windows version is not supporting the ConPty or WinPty disable the PSQL for
 that version. (PSQL option will not visible to the user).

 I have raised the issue with "pywinpty"
 https://github.com/spyder-ide/pywinpty/issues/161

 Regards,
 Nikhil Mohite

 On Fri, Jun 11, 2021 at 6:25 PM Dave Page  wrote:

> Hi
>
> On Fri, Jun 11, 2021 at 1:45 PM Fahar Abbas <
> fahar.ab...@enterprisedb.com> wrote:
>
>> Hi Dave,
>>
>> On Fri, Jun 11, 2021 at 1:39 PM Dave Page  wrote:
>>
>>>
>>>
>>> On Fri, Jun 11, 2021 at 9:35 AM Fahar Abbas <
>>> fahar.ab...@enterprisedb.com> wrote:
>>>
 Sure Dave, I will create a new VM with the latest iso.

>>>
>>> Not the latest. 1809 please. And if that doesn't work, 1909. We need
>>> to understand exactly what versions work and which don't.
>>>
>>> pgadmin4 is working fine on Windows 10 x64(1809).
>>
>
> Great, thanks!
>
>
>>
>> Do I also need to test pgadmin4 on 1909  iso?
>>
>
> I don't think so. I'm 99% certain that what we're seeing is that it
> works on the versions of Windows that support conpty, but not the older
> ones where the pywinpty library is *supposed* to fall back to using 
> winpty.
>
> Hopefully Nikhil can get to the bottom of the problem with the
> pywinpty folks.
>
>
>
>>
>>>
 Nikhil is not able to reproduce the issue on Windows 10 with the
 latest version. So the issue is reproducible with older versions.

 Kind Regards,
 On Fri, Jun 11, 2021 at 1:28 PM Dave Page 
 wrote:

>
>
> On Fri, Jun 11, 2021 at 9:25 AM Fahar Abbas <
> fahar.ab...@enterprisedb.com> wrote:
>
>> Windows 10 Enterprise 2016 LTSB.
>>
>
> Hmm, I assume that is version 1607. Can you test with 1809 please?
> And if that doesn't work, try 1909.
>
>
>>
>> On Fri, Jun 11, 2021 at 1:12 PM Dave Page 
>> wrote:
>>
>>> Hi
>>>
>>> On Fri, Jun 11, 2021 at 7:44 AM Fahar Abbas <
>>> fahar.ab...@enterprisedb.com> wrote:
>>>
 Hi,

 pgadmin4 is failing on following operating systems :
 Windows 2016
 Windows 2012
 Windows 07
 Windows 2008R2
 Windows 10 64

>>>
>>> What version of Windows 10? I *think* conpty was introduced in
>>> 1809.
>>>
>>>

 pgadmin4 is working fine in following operating system:
 Windows 2019

 On Thu, Jun 10, 2021 at 7:51 PM Dave Page 
 wrote:

>
>
> On Thu, Jun 10, 2021 at 2:22 PM Nikhil Mohite <
> nikhil.moh...@enterprisedb.com> wrote:
>
>> Hi Dave,
>>
>> On Thu, Jun 10, 2021 at 6:37 PM Dave Page 
>> wrote:
>>
>>> Hi
>>>
>>> On Thu, Jun 10, 2021 at 2:00 PM Nikhil Mohite <
>>> nikhil.moh...@enterprisedb.com> wrote:
>>>
 Hi Dave,

 On Thu, Jun 10, 2021 at 5:22 PM Dave Page <
 dp...@pgadmin.org> wrote:

> Hi
>
> On Thu, Jun 10, 2021 at 11:08 AM Nikhil Mohite <
> nikhil.moh...@enterprisedb.com> wrote:
>
>> Hi Dave/ Team,
>>
>> We are facing an issue with winpty.dll on Windows server
>> 2016 and Windows 7(these are platforms on which we have 
>> tested).
>> Files required for winpty are present in the

Re: [pgAdmin][RM-2341]: Add menu option for starting PSQL

2021-06-14 Thread Nikhil Mohite
Hi Akshay,

I have added the following commands for invalid command check:

   1. \lo_import
   2. \lo_export
   3. \w or write
   4. \o or \output
   5. \g

I am referring to the https://www.postgresql.org/docs/12/app-psql.html
link for finding the commands.
PFA patch V10.


On Mon, Jun 14, 2021 at 6:48 PM Dave Page  wrote:

> Hi
>
> On Mon, Jun 14, 2021 at 2:13 PM Nikhil Mohite <
> nikhil.moh...@enterprisedb.com> wrote:
>
>> Hi Akshay,
>>
>> Please find the updated patch for psql, Updated invalid command logic
>> added 3 more commands in it.
>> 1. \copy or \COPY
>> 2. \e or \E
>> 3. \ef or \EF
>>
>
> Should they just be case insensitive?
>
\ commands are case sensitive.

>
>
>>
>> Now user can't execute these commands if allow shell commands is set to
>> False.
>>
>
> What about \lo_import and \lo_export? I think those are potentially
> dangerous too. Also, \echo.
>
added this as well.

>
>
>>
>> If required any changes please let me know.
>>
>> Regards,
>> Nikhil Mohite
>>
>> On Mon, Jun 14, 2021 at 11:48 AM Akshay Joshi <
>> akshay.jo...@enterprisedb.com> wrote:
>>
>>> Thanks, the patch applied.
>>>
>>> On Mon, Jun 14, 2021 at 10:55 AM Nikhil Mohite <
>>> nikhil.moh...@enterprisedb.com> wrote:
>>>
 Hi Team,

 PFA patch v8

 On Mon, Jun 14, 2021 at 10:25 AM Nikhil Mohite <
 nikhil.moh...@enterprisedb.com> wrote:

> Hi Team,
>
> Please find the updated patch for the PSQL tool, Added check if the
> Windows version is not supporting the ConPty or WinPty disable the PSQL 
> for
> that version. (PSQL option will not visible to the user).
>
> I have raised the issue with "pywinpty"
> https://github.com/spyder-ide/pywinpty/issues/161
>
> Regards,
> Nikhil Mohite
>
> On Fri, Jun 11, 2021 at 6:25 PM Dave Page  wrote:
>
>> Hi
>>
>> On Fri, Jun 11, 2021 at 1:45 PM Fahar Abbas <
>> fahar.ab...@enterprisedb.com> wrote:
>>
>>> Hi Dave,
>>>
>>> On Fri, Jun 11, 2021 at 1:39 PM Dave Page  wrote:
>>>


 On Fri, Jun 11, 2021 at 9:35 AM Fahar Abbas <
 fahar.ab...@enterprisedb.com> wrote:

> Sure Dave, I will create a new VM with the latest iso.
>

 Not the latest. 1809 please. And if that doesn't work, 1909. We
 need to understand exactly what versions work and which don't.

 pgadmin4 is working fine on Windows 10 x64(1809).
>>>
>>
>> Great, thanks!
>>
>>
>>>
>>> Do I also need to test pgadmin4 on 1909  iso?
>>>
>>
>> I don't think so. I'm 99% certain that what we're seeing is that it
>> works on the versions of Windows that support conpty, but not the older
>> ones where the pywinpty library is *supposed* to fall back to using 
>> winpty.
>>
>> Hopefully Nikhil can get to the bottom of the problem with the
>> pywinpty folks.
>>
>>
>>
>>>

> Nikhil is not able to reproduce the issue on Windows 10 with the
> latest version. So the issue is reproducible with older versions.
>
> Kind Regards,
> On Fri, Jun 11, 2021 at 1:28 PM Dave Page 
> wrote:
>
>>
>>
>> On Fri, Jun 11, 2021 at 9:25 AM Fahar Abbas <
>> fahar.ab...@enterprisedb.com> wrote:
>>
>>> Windows 10 Enterprise 2016 LTSB.
>>>
>>
>> Hmm, I assume that is version 1607. Can you test with 1809
>> please? And if that doesn't work, try 1909.
>>
>>
>>>
>>> On Fri, Jun 11, 2021 at 1:12 PM Dave Page 
>>> wrote:
>>>
 Hi

 On Fri, Jun 11, 2021 at 7:44 AM Fahar Abbas <
 fahar.ab...@enterprisedb.com> wrote:

> Hi,
>
> pgadmin4 is failing on following operating systems :
> Windows 2016
> Windows 2012
> Windows 07
> Windows 2008R2
> Windows 10 64
>

 What version of Windows 10? I *think* conpty was introduced in
 1809.


>
> pgadmin4 is working fine in following operating system:
> Windows 2019
>
> On Thu, Jun 10, 2021 at 7:51 PM Dave Page 
> wrote:
>
>>
>>
>> On Thu, Jun 10, 2021 at 2:22 PM Nikhil Mohite <
>> nikhil.moh...@enterprisedb.com> wrote:
>>
>>> Hi Dave,
>>>
>>> On Thu, Jun 10, 2021 at 6:37 PM Dave Page 
>>> wrote:
>>>
 Hi

 On Thu, Jun 10, 2021 at 2:00 PM Nikhil Mohite <
 nikhil.moh...@enterprisedb.com> wrote:

> Hi Dave,
>
> On Thu, Jun 10

Re: [pgAdmin][RM-2341]: Add menu option for starting PSQL

2021-06-14 Thread Dave Page
Hi

On Mon, Jun 14, 2021 at 3:18 PM Nikhil Mohite <
nikhil.moh...@enterprisedb.com> wrote:

> Hi Akshay,
>
> I have added the following commands for invalid command check:
>
>1. \lo_import
>2. \lo_export
>3. \w or write
>4. \o or \output
>5. \g
>
> \qecho? \ev?

I'm very concerned we're missing more here, and will continue to miss new
commands that are added to psql in the future.

I think we need to disable the feature entirely in server mode by default,
and probably remove the code that attempts to filter out commands.

Then it just becomes a case of "this can be dangerous in server mode, as
your user will be able to run arbitrary commands on the server. Enable at
your own risk".


> I am referring to the https://www.postgresql.org/docs/12/app-psql.html
> link for finding the commands.
> PFA patch V10.
>
>
> On Mon, Jun 14, 2021 at 6:48 PM Dave Page  wrote:
>
>> Hi
>>
>> On Mon, Jun 14, 2021 at 2:13 PM Nikhil Mohite <
>> nikhil.moh...@enterprisedb.com> wrote:
>>
>>> Hi Akshay,
>>>
>>> Please find the updated patch for psql, Updated invalid command logic
>>> added 3 more commands in it.
>>> 1. \copy or \COPY
>>> 2. \e or \E
>>> 3. \ef or \EF
>>>
>>
>> Should they just be case insensitive?
>>
> \ commands are case sensitive.
>

So what are \E and \EF? I can't see them in the pg13 docs.


>
>>
>>>
>>> Now user can't execute these commands if allow shell commands is set to
>>> False.
>>>
>>
>> What about \lo_import and \lo_export? I think those are potentially
>> dangerous too. Also, \echo.
>>
> added this as well.
>
>>
>>
>>>
>>> If required any changes please let me know.
>>>
>>> Regards,
>>> Nikhil Mohite
>>>
>>> On Mon, Jun 14, 2021 at 11:48 AM Akshay Joshi <
>>> akshay.jo...@enterprisedb.com> wrote:
>>>
 Thanks, the patch applied.

 On Mon, Jun 14, 2021 at 10:55 AM Nikhil Mohite <
 nikhil.moh...@enterprisedb.com> wrote:

> Hi Team,
>
> PFA patch v8
>
> On Mon, Jun 14, 2021 at 10:25 AM Nikhil Mohite <
> nikhil.moh...@enterprisedb.com> wrote:
>
>> Hi Team,
>>
>> Please find the updated patch for the PSQL tool, Added check if the
>> Windows version is not supporting the ConPty or WinPty disable the PSQL 
>> for
>> that version. (PSQL option will not visible to the user).
>>
>> I have raised the issue with "pywinpty"
>> https://github.com/spyder-ide/pywinpty/issues/161
>>
>> Regards,
>> Nikhil Mohite
>>
>> On Fri, Jun 11, 2021 at 6:25 PM Dave Page  wrote:
>>
>>> Hi
>>>
>>> On Fri, Jun 11, 2021 at 1:45 PM Fahar Abbas <
>>> fahar.ab...@enterprisedb.com> wrote:
>>>
 Hi Dave,

 On Fri, Jun 11, 2021 at 1:39 PM Dave Page 
 wrote:

>
>
> On Fri, Jun 11, 2021 at 9:35 AM Fahar Abbas <
> fahar.ab...@enterprisedb.com> wrote:
>
>> Sure Dave, I will create a new VM with the latest iso.
>>
>
> Not the latest. 1809 please. And if that doesn't work, 1909. We
> need to understand exactly what versions work and which don't.
>
> pgadmin4 is working fine on Windows 10 x64(1809).

>>>
>>> Great, thanks!
>>>
>>>

 Do I also need to test pgadmin4 on 1909  iso?

>>>
>>> I don't think so. I'm 99% certain that what we're seeing is that it
>>> works on the versions of Windows that support conpty, but not the older
>>> ones where the pywinpty library is *supposed* to fall back to using 
>>> winpty.
>>>
>>> Hopefully Nikhil can get to the bottom of the problem with the
>>> pywinpty folks.
>>>
>>>
>>>

>
>> Nikhil is not able to reproduce the issue on Windows 10 with the
>> latest version. So the issue is reproducible with older versions.
>>
>> Kind Regards,
>> On Fri, Jun 11, 2021 at 1:28 PM Dave Page 
>> wrote:
>>
>>>
>>>
>>> On Fri, Jun 11, 2021 at 9:25 AM Fahar Abbas <
>>> fahar.ab...@enterprisedb.com> wrote:
>>>
 Windows 10 Enterprise 2016 LTSB.

>>>
>>> Hmm, I assume that is version 1607. Can you test with 1809
>>> please? And if that doesn't work, try 1909.
>>>
>>>

 On Fri, Jun 11, 2021 at 1:12 PM Dave Page 
 wrote:

> Hi
>
> On Fri, Jun 11, 2021 at 7:44 AM Fahar Abbas <
> fahar.ab...@enterprisedb.com> wrote:
>
>> Hi,
>>
>> pgadmin4 is failing on following operating systems :
>> Windows 2016
>> Windows 2012
>> Windows 07
>> Windows 2008R2
>> Windows 10 64
>>
>
> What version of Windows 10? I *think* conpty was introduced in
> 1809.

Re: [pgAdmin][RM-2341]: Add menu option for starting PSQL

2021-06-14 Thread Akshay Joshi
Hi Dave

On Mon, Jun 14, 2021 at 7:57 PM Dave Page  wrote:

> Hi
>
> On Mon, Jun 14, 2021 at 3:18 PM Nikhil Mohite <
> nikhil.moh...@enterprisedb.com> wrote:
>
>> Hi Akshay,
>>
>> I have added the following commands for invalid command check:
>>
>>1. \lo_import
>>2. \lo_export
>>3. \w or write
>>4. \o or \output
>>5. \g
>>
>> \qecho? \ev?
>
> I'm very concerned we're missing more here, and will continue to miss new
> commands that are added to psql in the future.
>
> I think we need to disable the feature entirely in server mode by default,
> and probably remove the code that attempts to filter out commands.
>

   If I understand correctly we need to change in config.py and make
ENABLE_PSQL = False in server mode.

>
> Then it just becomes a case of "this can be dangerous in server mode, as
> your user will be able to run arbitrary commands on the server. Enable at
> your own risk".
>

The above note will go into the config.py as a comment or in the
documentation.

>
>
>> I am referring to the https://www.postgresql.org/docs/12/app-psql.html
>> link for finding the commands.
>> PFA patch V10.
>>
>>
>> On Mon, Jun 14, 2021 at 6:48 PM Dave Page  wrote:
>>
>>> Hi
>>>
>>> On Mon, Jun 14, 2021 at 2:13 PM Nikhil Mohite <
>>> nikhil.moh...@enterprisedb.com> wrote:
>>>
 Hi Akshay,

 Please find the updated patch for psql, Updated invalid command logic
 added 3 more commands in it.
 1. \copy or \COPY
 2. \e or \E
 3. \ef or \EF

>>>
>>> Should they just be case insensitive?
>>>
>> \ commands are case sensitive.
>>
>
> So what are \E and \EF? I can't see them in the pg13 docs.
>
>
>>
>>>

 Now user can't execute these commands if allow shell commands is set to
 False.

>>>
>>> What about \lo_import and \lo_export? I think those are potentially
>>> dangerous too. Also, \echo.
>>>
>> added this as well.
>>
>>>
>>>

 If required any changes please let me know.

 Regards,
 Nikhil Mohite

 On Mon, Jun 14, 2021 at 11:48 AM Akshay Joshi <
 akshay.jo...@enterprisedb.com> wrote:

> Thanks, the patch applied.
>
> On Mon, Jun 14, 2021 at 10:55 AM Nikhil Mohite <
> nikhil.moh...@enterprisedb.com> wrote:
>
>> Hi Team,
>>
>> PFA patch v8
>>
>> On Mon, Jun 14, 2021 at 10:25 AM Nikhil Mohite <
>> nikhil.moh...@enterprisedb.com> wrote:
>>
>>> Hi Team,
>>>
>>> Please find the updated patch for the PSQL tool, Added check if the
>>> Windows version is not supporting the ConPty or WinPty disable the PSQL 
>>> for
>>> that version. (PSQL option will not visible to the user).
>>>
>>> I have raised the issue with "pywinpty"
>>> https://github.com/spyder-ide/pywinpty/issues/161
>>>
>>> Regards,
>>> Nikhil Mohite
>>>
>>> On Fri, Jun 11, 2021 at 6:25 PM Dave Page  wrote:
>>>
 Hi

 On Fri, Jun 11, 2021 at 1:45 PM Fahar Abbas <
 fahar.ab...@enterprisedb.com> wrote:

> Hi Dave,
>
> On Fri, Jun 11, 2021 at 1:39 PM Dave Page 
> wrote:
>
>>
>>
>> On Fri, Jun 11, 2021 at 9:35 AM Fahar Abbas <
>> fahar.ab...@enterprisedb.com> wrote:
>>
>>> Sure Dave, I will create a new VM with the latest iso.
>>>
>>
>> Not the latest. 1809 please. And if that doesn't work, 1909. We
>> need to understand exactly what versions work and which don't.
>>
>> pgadmin4 is working fine on Windows 10 x64(1809).
>

 Great, thanks!


>
> Do I also need to test pgadmin4 on 1909  iso?
>

 I don't think so. I'm 99% certain that what we're seeing is that it
 works on the versions of Windows that support conpty, but not the older
 ones where the pywinpty library is *supposed* to fall back to using 
 winpty.

 Hopefully Nikhil can get to the bottom of the problem with the
 pywinpty folks.



>
>>
>>> Nikhil is not able to reproduce the issue on Windows 10 with the
>>> latest version. So the issue is reproducible with older versions.
>>>
>>> Kind Regards,
>>> On Fri, Jun 11, 2021 at 1:28 PM Dave Page 
>>> wrote:
>>>


 On Fri, Jun 11, 2021 at 9:25 AM Fahar Abbas <
 fahar.ab...@enterprisedb.com> wrote:

> Windows 10 Enterprise 2016 LTSB.
>

 Hmm, I assume that is version 1607. Can you test with 1809
 please? And if that doesn't work, try 1909.


>
> On Fri, Jun 11, 2021 at 1:12 PM Dave Page 
> wrote:
>
>> Hi
>>
>> On Fri, Jun 11, 2021 at 7:44 AM Fahar Abbas 

Re: [pgAdmin][RM-2341]: Add menu option for starting PSQL

2021-06-14 Thread Nikhil Mohite
Hi Dave,

On Mon, Jun 14, 2021 at 8:05 PM Akshay Joshi 
wrote:

> Hi Dave
>
> On Mon, Jun 14, 2021 at 7:57 PM Dave Page  wrote:
>
>> Hi
>>
>> On Mon, Jun 14, 2021 at 3:18 PM Nikhil Mohite <
>> nikhil.moh...@enterprisedb.com> wrote:
>>
>>> Hi Akshay,
>>>
>>> I have added the following commands for invalid command check:
>>>
>>>1. \lo_import
>>>2. \lo_export
>>>3. \w or write
>>>4. \o or \output
>>>5. \g
>>>
>>> \qecho? \ev?
>>
>> I'm very concerned we're missing more here, and will continue to miss new
>> commands that are added to psql in the future.
>>
>> I think we need to disable the feature entirely in server mode by
>> default, and probably remove the code that attempts to filter out commands.
>>
> In this case, ALLOW_SHELL_COMMAND will be not useful, should we remove it
from config.py?

>
>If I understand correctly we need to change in config.py and make
> ENABLE_PSQL = False in server mode.
>
>>
>> Then it just becomes a case of "this can be dangerous in server mode, as
>> your user will be able to run arbitrary commands on the server. Enable at
>> your own risk".
>>
>
> The above note will go into the config.py as a comment or in the
> documentation.
>

>>
>>> I am referring to the https://www.postgresql.org/docs/12/app-psql.html
>>> link for finding the commands.
>>> PFA patch V10.
>>>
>>>
>>> On Mon, Jun 14, 2021 at 6:48 PM Dave Page  wrote:
>>>
 Hi

 On Mon, Jun 14, 2021 at 2:13 PM Nikhil Mohite <
 nikhil.moh...@enterprisedb.com> wrote:

> Hi Akshay,
>
> Please find the updated patch for psql, Updated invalid command logic
> added 3 more commands in it.
> 1. \copy or \COPY
> 2. \e or \E
> 3. \ef or \EF
>

 Should they just be case insensitive?

>>> \ commands are case sensitive.
>>>
>>
>> So what are \E and \EF? I can't see them in the pg13 docs.
>>
> These commands open the vi editor on macOS and notepad on windows for
writing the commands.

>
>>
>>>

>
> Now user can't execute these commands if allow shell commands is set
> to False.
>

 What about \lo_import and \lo_export? I think those are potentially
 dangerous too. Also, \echo.

>>> added this as well.
>>>


>
> If required any changes please let me know.
>
> Regards,
> Nikhil Mohite
>
> On Mon, Jun 14, 2021 at 11:48 AM Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
>
>> Thanks, the patch applied.
>>
>> On Mon, Jun 14, 2021 at 10:55 AM Nikhil Mohite <
>> nikhil.moh...@enterprisedb.com> wrote:
>>
>>> Hi Team,
>>>
>>> PFA patch v8
>>>
>>> On Mon, Jun 14, 2021 at 10:25 AM Nikhil Mohite <
>>> nikhil.moh...@enterprisedb.com> wrote:
>>>
 Hi Team,

 Please find the updated patch for the PSQL tool, Added check if the
 Windows version is not supporting the ConPty or WinPty disable the 
 PSQL for
 that version. (PSQL option will not visible to the user).

 I have raised the issue with "pywinpty"
 https://github.com/spyder-ide/pywinpty/issues/161

 Regards,
 Nikhil Mohite

 On Fri, Jun 11, 2021 at 6:25 PM Dave Page 
 wrote:

> Hi
>
> On Fri, Jun 11, 2021 at 1:45 PM Fahar Abbas <
> fahar.ab...@enterprisedb.com> wrote:
>
>> Hi Dave,
>>
>> On Fri, Jun 11, 2021 at 1:39 PM Dave Page 
>> wrote:
>>
>>>
>>>
>>> On Fri, Jun 11, 2021 at 9:35 AM Fahar Abbas <
>>> fahar.ab...@enterprisedb.com> wrote:
>>>
 Sure Dave, I will create a new VM with the latest iso.

>>>
>>> Not the latest. 1809 please. And if that doesn't work, 1909. We
>>> need to understand exactly what versions work and which don't.
>>>
>>> pgadmin4 is working fine on Windows 10 x64(1809).
>>
>
> Great, thanks!
>
>
>>
>> Do I also need to test pgadmin4 on 1909  iso?
>>
>
> I don't think so. I'm 99% certain that what we're seeing is that
> it works on the versions of Windows that support conpty, but not the 
> older
> ones where the pywinpty library is *supposed* to fall back to using 
> winpty.
>
> Hopefully Nikhil can get to the bottom of the problem with the
> pywinpty folks.
>
>
>
>>
>>>
 Nikhil is not able to reproduce the issue on Windows 10 with
 the latest version. So the issue is reproducible with older 
 versions.

 Kind Regards,
 On Fri, Jun 11, 2021 at 1:28 PM Dave Page 
 wrote:

>
>
> On Fri, Jun 11, 2021 at 9:25 AM Fahar Abbas <
> fahar.ab..

Re: [pgAdmin][RM-2341]: Add menu option for starting PSQL

2021-06-14 Thread Dave Page
On Mon, Jun 14, 2021 at 3:35 PM Akshay Joshi 
wrote:

> Hi Dave
>
> On Mon, Jun 14, 2021 at 7:57 PM Dave Page  wrote:
>
>> Hi
>>
>> On Mon, Jun 14, 2021 at 3:18 PM Nikhil Mohite <
>> nikhil.moh...@enterprisedb.com> wrote:
>>
>>> Hi Akshay,
>>>
>>> I have added the following commands for invalid command check:
>>>
>>>1. \lo_import
>>>2. \lo_export
>>>3. \w or write
>>>4. \o or \output
>>>5. \g
>>>
>>> \qecho? \ev?
>>
>> I'm very concerned we're missing more here, and will continue to miss new
>> commands that are added to psql in the future.
>>
>> I think we need to disable the feature entirely in server mode by
>> default, and probably remove the code that attempts to filter out commands.
>>
>
>If I understand correctly we need to change in config.py and make
> ENABLE_PSQL = False in server mode.
>

Right - but we'd also have the redundant command filtering code (and config
option), which we should remove.


>
>> Then it just becomes a case of "this can be dangerous in server mode, as
>> your user will be able to run arbitrary commands on the server. Enable at
>> your own risk".
>>
>
> The above note will go into the config.py as a comment or in the
> documentation.
>

I'm thinking the patch to config.py would be something like the following.
There would be other minor changes required of course, but this part of the
patch should indicate what would be required:

Index: web/config.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===
diff --git a/web/config.py b/web/config.py
--- a/web/config.py (revision 4a3a5174b2b0793cea0a2575c10814a784f5f0a1)
+++ b/web/config.py (date 1623241653320)
@@ -645,18 +645,12 @@
 ##
 # PSQL tool settings
 ##
-# This will enable PSQL tool in pgAdmin. So user can execute the commands
-# using PSQL terminal in pgAdmin.
-ENABLE_PSQL = True
+# This will enable PSQL tool in pgAdmin when running in server mode.
+# PSQL is always enabled in Desktop mode, however in server mode it is
+# disabled by default because users can run arbitrary commands on the
+# server through it.
+ENABLE_PSQL = False

-# ALLOW_PSQL_SHELL_COMMAND = True will disable the execution of os level
-# commands using meta command \! from PSQL terminal.
-# As PSQL allow user to execute the os level commands from the PSQL
terminal
-# user can execute any system level command as per the system login user
-# privileges. Default this setting is set to False but if it set to True
-# User will able to execute the system level commands through PSQL terminal
-# in pgAdmin.
-ALLOW_PSQL_SHELL_COMMANDS = False
 ##
 # ENABLE_BINARY_PATH_BROWSING setting is used to enable the browse button
 # while selecting binary path for the database server in server mode.




>
>>
>>> I am referring to the https://www.postgresql.org/docs/12/app-psql.html
>>> link for finding the commands.
>>> PFA patch V10.
>>>
>>>
>>> On Mon, Jun 14, 2021 at 6:48 PM Dave Page  wrote:
>>>
 Hi

 On Mon, Jun 14, 2021 at 2:13 PM Nikhil Mohite <
 nikhil.moh...@enterprisedb.com> wrote:

> Hi Akshay,
>
> Please find the updated patch for psql, Updated invalid command logic
> added 3 more commands in it.
> 1. \copy or \COPY
> 2. \e or \E
> 3. \ef or \EF
>

 Should they just be case insensitive?

>>> \ commands are case sensitive.
>>>
>>
>> So what are \E and \EF? I can't see them in the pg13 docs.
>>
>>
>>>

>
> Now user can't execute these commands if allow shell commands is set
> to False.
>

 What about \lo_import and \lo_export? I think those are potentially
 dangerous too. Also, \echo.

>>> added this as well.
>>>


>
> If required any changes please let me know.
>
> Regards,
> Nikhil Mohite
>
> On Mon, Jun 14, 2021 at 11:48 AM Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
>
>> Thanks, the patch applied.
>>
>> On Mon, Jun 14, 2021 at 10:55 AM Nikhil Mohite <
>> nikhil.moh...@enterprisedb.com> wrote:
>>
>>> Hi Team,
>>>
>>> PFA patch v8
>>>
>>> On Mon, Jun 14, 2021 at 10:25 AM Nikhil Mohite <
>>> nikhil.moh...@enterprisedb.com> wrote:
>>>
 Hi Team,

 Please find the updated patch for the PSQL tool, Added check if the
 Windows version is not supporting the ConPty or WinPty disable the 
 PSQL for
 that version. (PSQL option will not visible to the user).

 I have raised the issue with "pywinpty"
 https://github.com/spyder-ide/pywinpty/issues/161

 Regards,
 Nikhil Mohite

 On Fri, Jun 11, 2021 at 6:25 PM Dave Page

Re: [pgAdmin][RM-2341]: Add menu option for starting PSQL

2021-06-14 Thread Dave Page
Hi

On Mon, Jun 14, 2021 at 3:43 PM Nikhil Mohite <
nikhil.moh...@enterprisedb.com> wrote:

> Hi Dave,
>
> On Mon, Jun 14, 2021 at 8:05 PM Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
>
>> Hi Dave
>>
>> On Mon, Jun 14, 2021 at 7:57 PM Dave Page  wrote:
>>
>>> Hi
>>>
>>> On Mon, Jun 14, 2021 at 3:18 PM Nikhil Mohite <
>>> nikhil.moh...@enterprisedb.com> wrote:
>>>
 Hi Akshay,

 I have added the following commands for invalid command check:

1. \lo_import
2. \lo_export
3. \w or write
4. \o or \output
5. \g

 \qecho? \ev?
>>>
>>> I'm very concerned we're missing more here, and will continue to miss
>>> new commands that are added to psql in the future.
>>>
>>> I think we need to disable the feature entirely in server mode by
>>> default, and probably remove the code that attempts to filter out commands.
>>>
>> In this case, ALLOW_SHELL_COMMAND will be not useful, should we remove it
> from config.py?
>

Right, that's what I'm suggesting (see previous email).

We simply do the following:

- Always enable psql in desktop mode.
- Only enable psql in server mode, if the admin overrides the default
configuration


>
>>If I understand correctly we need to change in config.py and make
>> ENABLE_PSQL = False in server mode.
>>
>>>
>>> Then it just becomes a case of "this can be dangerous in server mode, as
>>> your user will be able to run arbitrary commands on the server. Enable at
>>> your own risk".
>>>
>>
>> The above note will go into the config.py as a comment or in the
>> documentation.
>>
>
>>>
 I am referring to the https://www.postgresql.org/docs/12/app-psql.html
 link for finding the commands.
 PFA patch V10.


 On Mon, Jun 14, 2021 at 6:48 PM Dave Page  wrote:

> Hi
>
> On Mon, Jun 14, 2021 at 2:13 PM Nikhil Mohite <
> nikhil.moh...@enterprisedb.com> wrote:
>
>> Hi Akshay,
>>
>> Please find the updated patch for psql, Updated invalid command logic
>> added 3 more commands in it.
>> 1. \copy or \COPY
>> 2. \e or \E
>> 3. \ef or \EF
>>
>
> Should they just be case insensitive?
>
 \ commands are case sensitive.

>>>
>>> So what are \E and \EF? I can't see them in the pg13 docs.
>>>
>> These commands open the vi editor on macOS and notepad on windows for
> writing the commands.
>

Not on my installation:

postgres=# \E
invalid command \E
Try \? for help.
postgres=# \EF
invalid command \EF
Try \? for help.

\e and \ef (and \ev) do what you describe though.


>
>>>

>
>>
>> Now user can't execute these commands if allow shell commands is set
>> to False.
>>
>
> What about \lo_import and \lo_export? I think those are potentially
> dangerous too. Also, \echo.
>
 added this as well.

>
>
>>
>> If required any changes please let me know.
>>
>> Regards,
>> Nikhil Mohite
>>
>> On Mon, Jun 14, 2021 at 11:48 AM Akshay Joshi <
>> akshay.jo...@enterprisedb.com> wrote:
>>
>>> Thanks, the patch applied.
>>>
>>> On Mon, Jun 14, 2021 at 10:55 AM Nikhil Mohite <
>>> nikhil.moh...@enterprisedb.com> wrote:
>>>
 Hi Team,

 PFA patch v8

 On Mon, Jun 14, 2021 at 10:25 AM Nikhil Mohite <
 nikhil.moh...@enterprisedb.com> wrote:

> Hi Team,
>
> Please find the updated patch for the PSQL tool, Added check if
> the Windows version is not supporting the ConPty or WinPty disable 
> the PSQL
> for that version. (PSQL option will not visible to the user).
>
> I have raised the issue with "pywinpty"
> https://github.com/spyder-ide/pywinpty/issues/161
>
> Regards,
> Nikhil Mohite
>
> On Fri, Jun 11, 2021 at 6:25 PM Dave Page 
> wrote:
>
>> Hi
>>
>> On Fri, Jun 11, 2021 at 1:45 PM Fahar Abbas <
>> fahar.ab...@enterprisedb.com> wrote:
>>
>>> Hi Dave,
>>>
>>> On Fri, Jun 11, 2021 at 1:39 PM Dave Page 
>>> wrote:
>>>


 On Fri, Jun 11, 2021 at 9:35 AM Fahar Abbas <
 fahar.ab...@enterprisedb.com> wrote:

> Sure Dave, I will create a new VM with the latest iso.
>

 Not the latest. 1809 please. And if that doesn't work, 1909. We
 need to understand exactly what versions work and which don't.

 pgadmin4 is working fine on Windows 10 x64(1809).
>>>
>>
>> Great, thanks!
>>
>>
>>>
>>> Do I also need to test pgadmin4 on 1909  iso?
>>>
>>
>> I don't think so. I'm 99% certain that what we're seeing is that
>> it works on the versions of Windows that support conpty, but not the 
>

pgAdmin 4 commit: If the binary path contains '' then show as it is on

2021-06-14 Thread Akshay Joshi
If the binary path contains '' then show as it is on GUI if the path contains 
valid utilities.

Branch
--
master

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

Modified Files
--
web/pgadmin/utils/__init__.py | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)



pgAdmin 4 commit: Update version for release.

2021-06-14 Thread Akshay Joshi
Update version for release.

Branch
--
master

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

Modified Files
--
web/config.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)



pgAdmin 4 commit: 1) Disable the PSQL feature entirely in server mode b

2021-06-14 Thread Akshay Joshi
1) Disable the PSQL feature entirely in server mode by default.
2) Remove the code that attempts to filter out commands.

refs #2341

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=2549688bdf2de9093c1140e2b92a0aca119c45c7
Author: Nikhil Mohite 

Modified Files
--
docs/en_US/psql_tool.rst  |   4 -
web/config.py |  19 ++--
web/pgadmin/browser/templates/browser/js/utils.js |   1 -
web/pgadmin/tools/psql/__init__.py| 106 +-
4 files changed, 9 insertions(+), 121 deletions(-)



pgAdmin 4 commit: Ensure that the calendar control should be disabled i

2021-06-14 Thread Akshay Joshi
Ensure that the calendar control should be disabled in the properties panel for 
Role. Fixes #6469.

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=71526ac79f6c5a9e6c0b87d17b67158db16a7172
Author: Nikhil Mohite 

Modified Files
--
docs/en_US/release_notes_5_4.rst  | 1 +
web/pgadmin/static/js/backform.pgadmin.js | 5 +
2 files changed, 6 insertions(+)



pgAdmin 4 commit: Update DEPENDENCIES.

2021-06-14 Thread Akshay Joshi
Update DEPENDENCIES.

Branch
--
master

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

Modified Files
--
DEPENDENCIES | 155 +--
1 file changed, 86 insertions(+), 69 deletions(-)



pgAdmin 4 commit: Updated variable name as per review comments.

2021-06-14 Thread Akshay Joshi
Updated variable name as per review comments.

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=3d685ef96c6a4dfe6d7e77b71ea075d50fae9f13
Author: Pradip Parkale 

Modified Files
--
web/pgadmin/utils/driver/psycopg2/typecast.py | 8 
1 file changed, 4 insertions(+), 4 deletions(-)



Re: [pgAdmin][RM-6469]: Role node: Calender control is not disabled in properties panel

2021-06-14 Thread Akshay Joshi
Thanks, the patch applied.

On Mon, Jun 14, 2021 at 3:15 PM Nikhil Mohite <
nikhil.moh...@enterprisedb.com> wrote:

> Hi Hackers,
>
> Please find the attached patch for RM-6469
> :  Role node: Calender
> control is not disabled in properties panel.
>
>
> --
> *Thanks & Regards,*
> *Nikhil Mohite*
> *Software Engineer.*
> *EDB Postgres* 
> *Mob.No: +91-7798364578.*
>


-- 
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Principal Software Architect*
*EDB Postgres *

*Mobile: +91 976-788-8246*


pgAdmin4 v5.4 candidate builds

2021-06-14 Thread Akshay Joshi
Hi All,

pgAdmin4 v5.4 candidate builds and source can be found at
https://developer.pgadmin.org/builds/2021-06-14-1/

Fahar, can you please verify it for release on Thursday.

-- 
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Principal Software Architect*
*EDB Postgres *

*Mobile: +91 976-788-8246*