Обсуждение: Fix for issue RM1220 and RM 1221 [pgadmin4]

Поиск
Список
Период
Сортировка

Fix for issue RM1220 and RM 1221 [pgadmin4]

От
Harshal Dhumal
Дата:
Hi,

PFA patch for issues RM1220 and RM1221

Issue fixed: Backup, Restore and Maintenance were causing error with database name  with special characters.

-- 
Harshal Dhumal
Software Engineer

EnterpriseDB India: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Вложения

Re: Fix for issue RM1220 and RM 1221 [pgadmin4]

От
Harshal Dhumal
Дата:
Hi,

This patch consist fix for only RM1220
I'll send another patch for RM1221

-- 
Harshal Dhumal
Software Engineer

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

On Tue, Jun 21, 2016 at 4:08 PM, Harshal Dhumal <harshal.dhumal@enterprisedb.com> wrote:
Hi,

PFA patch for issues RM1220 and RM1221

Issue fixed: Backup, Restore and Maintenance were causing error with database name  with special characters.

-- 
Harshal Dhumal
Software Engineer

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

Re: Fix for issue RM1220 and RM 1221 [pgadmin4]

От
Dave Page
Дата:
Hi

On Tue, Jun 21, 2016 at 11:38 AM, Harshal Dhumal
<harshal.dhumal@enterprisedb.com> wrote:
> Hi,
>
> PFA patch for issues RM1220 and RM1221
>
> Issue fixed: Backup, Restore and Maintenance were causing error with
> database name  with special characters.

This patch causes the following error when attempting to run a backup:

"quotechar" must be string, not unicode

If I fix that (by wrapping the '' in str()), it then fails with:

need to escape but no escapechar set.

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

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


Re: Fix for issue RM1220 and RM 1221 [pgadmin4]

От
Harshal Dhumal
Дата:
Hi,

PFA updated patch for issues 1220 and 1221

-- 
Harshal Dhumal
Software Engineer

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

On Tue, Jun 21, 2016 at 4:41 PM, Dave Page <dpage@pgadmin.org> wrote:
Hi

On Tue, Jun 21, 2016 at 11:38 AM, Harshal Dhumal
<harshal.dhumal@enterprisedb.com> wrote:
> Hi,
>
> PFA patch for issues RM1220 and RM1221
>
> Issue fixed: Backup, Restore and Maintenance were causing error with
> database name  with special characters.

This patch causes the following error when attempting to run a backup:

"quotechar" must be string, not unicode

If I fix that (by wrapping the '' in str()), it then fails with:

need to escape but no escapechar set.

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

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

Вложения

Re: Fix for issue RM1220 and RM 1221 [pgadmin4]

От
Dave Page
Дата:
On Wed, Jun 22, 2016 at 11:09 AM, Harshal Dhumal
<harshal.dhumal@enterprisedb.com> wrote:
> Hi,
>
> PFA updated patch for issues 1220 and 1221

Hi

Still not working I'm afraid:

Backing up an object on the server 'PostgreSQL 9.4 (127.0.0.1:5432)'
from database '!#$%^&*()_+{}|:"<>?=-\][';/.,'...
Running command:
/Library/PostgreSQL/9.5/bin/pg_dump --file
"/Users/dpage/.pgadmin/storage/dpage/foo.sql" --host "127.0.0.1"
--port "5432" --username "postgres" --no-password --verbose --format=c
--blobs --section=pre-data --section=data --section=post-data
"!#$%^&*()_+{}|:\"<>?=-\\][';/.,"

Start time: Thu Jun 23 2016 11:49:06 GMT+0100 (BST)

pg_dump: [archiver (db)] connection to database "" failed: invalid
connection option "!#$%^&*()_+{}|:"<>?"
error: [Errno 9] Bad file descriptor
r = self.sock.recv(1024)
File "/Applications/PyCharm
CE.app/Contents/helpers/pydev/pydevd_comm.py", line 329, in OnRun
Traceback (most recent call last):




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

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


Re: Fix for issue RM1220 and RM 1221 [pgadmin4]

От
Harshal Dhumal
Дата:
Hi Dave,

It seems that pg_dump utility does not handle database name properly with equal to (=) sign in it.

Observe above stack trace, we are generating command line command properly. However pg_dump only takes database name upto equal to sign reset is ignored.

e.g. Database name in command is "!#$%^&*()_+{}|:\"<>?=-\\][';/.," but in pg_dump error it says failed: invalid connection option "!#$%^&*()_+{}|:"<>?"


-- 
Harshal Dhumal
Software Engineer

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

On Thu, Jun 23, 2016 at 4:19 PM, Dave Page <dpage@pgadmin.org> wrote:
On Wed, Jun 22, 2016 at 11:09 AM, Harshal Dhumal
<harshal.dhumal@enterprisedb.com> wrote:
> Hi,
>
> PFA updated patch for issues 1220 and 1221

Hi

Still not working I'm afraid:

Backing up an object on the server 'PostgreSQL 9.4 (127.0.0.1:5432)'
from database '!#$%^&*()_+{}|:"<>?=-\][';/.,'...
Running command:
/Library/PostgreSQL/9.5/bin/pg_dump --file
"/Users/dpage/.pgadmin/storage/dpage/foo.sql" --host "127.0.0.1"
--port "5432" --username "postgres" --no-password --verbose --format=c
--blobs --section=pre-data --section=data --section=post-data
"!#$%^&*()_+{}|:\"<>?=-\\][';/.,"

Start time: Thu Jun 23 2016 11:49:06 GMT+0100 (BST)

pg_dump: [archiver (db)] connection to database "" failed: invalid
connection option "!#$%^&*()_+{}|:"<>?"
error: [Errno 9] Bad file descriptor
r = self.sock.recv(1024)
File "/Applications/PyCharm
CE.app/Contents/helpers/pydev/pydevd_comm.py", line 329, in OnRun
Traceback (most recent call last):




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

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

Re: Fix for issue RM1220 and RM 1221 [pgadmin4]

От
Harshal Dhumal
Дата:
One more thing that this also fails in pgadmin3 as well.

-- 
Harshal Dhumal
Software Engineer

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

On Thu, Jun 23, 2016 at 6:26 PM, Harshal Dhumal <harshal.dhumal@enterprisedb.com> wrote:
Hi Dave,

It seems that pg_dump utility does not handle database name properly with equal to (=) sign in it.

Observe above stack trace, we are generating command line command properly. However pg_dump only takes database name upto equal to sign reset is ignored.

e.g. Database name in command is "!#$%^&*()_+{}|:\"<>?=-\\][';/.," but in pg_dump error it says failed: invalid connection option "!#$%^&*()_+{}|:"<>?"


-- 
Harshal Dhumal
Software Engineer

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

On Thu, Jun 23, 2016 at 4:19 PM, Dave Page <dpage@pgadmin.org> wrote:
On Wed, Jun 22, 2016 at 11:09 AM, Harshal Dhumal
<harshal.dhumal@enterprisedb.com> wrote:
> Hi,
>
> PFA updated patch for issues 1220 and 1221

Hi

Still not working I'm afraid:

Backing up an object on the server 'PostgreSQL 9.4 (127.0.0.1:5432)'
from database '!#$%^&*()_+{}|:"<>?=-\][';/.,'...
Running command:
/Library/PostgreSQL/9.5/bin/pg_dump --file
"/Users/dpage/.pgadmin/storage/dpage/foo.sql" --host "127.0.0.1"
--port "5432" --username "postgres" --no-password --verbose --format=c
--blobs --section=pre-data --section=data --section=post-data
"!#$%^&*()_+{}|:\"<>?=-\\][';/.,"

Start time: Thu Jun 23 2016 11:49:06 GMT+0100 (BST)

pg_dump: [archiver (db)] connection to database "" failed: invalid
connection option "!#$%^&*()_+{}|:"<>?"
error: [Errno 9] Bad file descriptor
r = self.sock.recv(1024)
File "/Applications/PyCharm
CE.app/Contents/helpers/pydev/pydevd_comm.py", line 329, in OnRun
Traceback (most recent call last):




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

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


Re: Fix for issue RM1220 and RM 1221 [pgadmin4]

От
Ashesh Vashi
Дата:
On Thu, Jun 23, 2016 at 6:26 PM, Harshal Dhumal <harshal.dhumal@enterprisedb.com> wrote:
Hi Dave,

It seems that pg_dump utility does not handle database name properly with equal to (=) sign in it.

Observe above stack trace, we are generating command line command properly. However pg_dump only takes database name upto equal to sign reset is ignored.

e.g. Database name in command is "!#$%^&*()_+{}|:\"<>?=-\\][';/.," but in pg_dump error it says failed: invalid connection option "!#$%^&*()_+{}|:"<>?"

For more information, 'getopt_long' function used in pg_dump returns only the second value, when we pass the above value properly.

Can we get the information on how to escape '=' (equal sign) with getopt_long(..) function?

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company





-- 
Harshal Dhumal
Software Engineer

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

On Thu, Jun 23, 2016 at 4:19 PM, Dave Page <dpage@pgadmin.org> wrote:
On Wed, Jun 22, 2016 at 11:09 AM, Harshal Dhumal
<harshal.dhumal@enterprisedb.com> wrote:
> Hi,
>
> PFA updated patch for issues 1220 and 1221

Hi

Still not working I'm afraid:

Backing up an object on the server 'PostgreSQL 9.4 (127.0.0.1:5432)'
from database '!#$%^&*()_+{}|:"<>?=-\][';/.,'...
Running command:
/Library/PostgreSQL/9.5/bin/pg_dump --file
"/Users/dpage/.pgadmin/storage/dpage/foo.sql" --host "127.0.0.1"
--port "5432" --username "postgres" --no-password --verbose --format=c
--blobs --section=pre-data --section=data --section=post-data
"!#$%^&*()_+{}|:\"<>?=-\\][';/.,"

Start time: Thu Jun 23 2016 11:49:06 GMT+0100 (BST)

pg_dump: [archiver (db)] connection to database "" failed: invalid
connection option "!#$%^&*()_+{}|:"<>?"
error: [Errno 9] Bad file descriptor
r = self.sock.recv(1024)
File "/Applications/PyCharm
CE.app/Contents/helpers/pydev/pydevd_comm.py", line 329, in OnRun
Traceback (most recent call last):




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

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