pgadmin-org / pgadmin4

pgAdmin is the most popular and feature rich Open Source administration and development platform for PostgreSQL, the most advanced Open Source database in the world.
https://www.pgadmin.org
Other
2.43k stars 638 forks source link

[Web Based] Export database failed if object contains double quotes (RM #1603) #542

Closed dpage closed 2 years ago

dpage commented 8 years ago

Issue migrated from Redmine: https://redmine.postgresql.org/issues/1603 Originally created by Fahar Abbas at 2016-08-25 12:53:16 UTC.

Commit ID:

commit e016869ad5b0377091ffd909ac9d5982e5574905

Tested Platform:

Ubuntu 14.04 Linux 32(Python 3.4.3) Windows 2012 server R2 64(Python 2.7.11)

Export database failed if object contains double quotes. Please note that this issue is in reproducible with simple table(object).

  1. Launch pgAdmin4
  2. Create new database q m g r o c k s
  3. inside this database create schema q m g r o c k s
  4. in this newly created schema create following table

CREATE TABLE "q m g r o c k s"."q m g r o c k s " ( "q m g r o c k s" "char" ) WITH ( OIDS=FALSE );

  1. table created successfully with q m g r o c k s
  2. Right Click and select import/Expert data
  3. provide C:\test234 in file name section
  4. click on OK
  5. Exit code 2 displayed
  6. psql: FATAL: database ""q m g r o c k s"" does not exist

dpage commented 8 years ago

Attachment migrated from Redmine: https://redmine.postgresql.org/attachments/download/1570 Originally created by Fahar Abbas at 2016-08-25 12:50:45 UTC.

https://pgadmin-archive.postgresql.org/redmine/1603/1570-Screen_Shot_2016-08-25_at_5.49.14_pm.png

dpage commented 8 years ago

Attachment migrated from Redmine: https://redmine.postgresql.org/attachments/download/1571 Originally created by Fahar Abbas at 2016-08-25 12:50:51 UTC.

https://pgadmin-archive.postgresql.org/redmine/1603/1571-Screen_Shot_2016-08-25_at_5.49.18_pm.png

dpage commented 7 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/1603#note-3 Originally created by Dave Page at 2016-09-30 09:29:07 UTC.

Testing on Mac in server mode I get:

psql: FATAL: database ""q m g r o c k s"" does not exist

With a command line of:

/Library/PostgreSQL/9.6/bin/psql --host "172.16.254.22" --port "5444" --username "enterprisedb" --dbname "\"q m g r o c k s\"" --command "\copy "q m g r o c k s"."q m g r o c k s " ("q m g r o c k s") TO '/test234' DELIMITER ';' CSV QUOTE '"' ESCAPE '''';"

In the runtime on Mac, absolutely nothing happens, as if the job was never launched.

Redmine ticket header update:

Name Old Value New Value
Priority changed Normal Urgent
Fixed Version changed 1.1
dpage commented 7 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/1603#note-4 Originally created by Khushboo Vashi at 2016-10-07 04:41:20 UTC.

Redmine ticket header update:

Name Old Value New Value
Assigned To changed Khushboo Vashi
dpage commented 7 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/1603#note-5 Originally created by Khushboo Vashi at 2016-10-07 04:59:17 UTC.

Redmine ticket header update:

Name Old Value New Value
Relationship (relates) changed RM #1220
dpage commented 7 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/1603#note-6 Originally created by Khushboo Vashi at 2016-10-07 05:02:44 UTC.

This issue is related to RM 1220 and RM 1221. Harshal has worked on this issue and sent the patch for the same.

https://www.postgresql.org/message-id/flat/CAFiP3vxnzA88uDidUpk-jG%2BeKMiy%3D7g_1kMzzrsEqg8yo53ghg%40mail.gmail.com#CAFiP3vxnzA88uDidUpk-jG+eKMiy=7g_1kMzzrsEqg8yo53ghg@mail.gmail.com

Harshal/Dave,

Can you please confirm this issue has been fixed or not?

Redmine ticket header update:

Name Old Value New Value
Assigned To changed Khushboo Vashi Dave Page
dpage commented 7 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/1603#note-7 Originally created by Dave Page at 2016-10-07 08:02:37 UTC.

I believe it's still broken. As far as I can see from the thread, Harshal's patch wasn't committed and Ashesh had asked how to escape =.

Redmine ticket header update:

Name Old Value New Value
Assigned To changed Dave Page Khushboo Vashi
dpage commented 7 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/1603#note-8 Originally created by Khushboo Vashi at 2016-10-14 05:57:12 UTC.

Redmine ticket header update:

Name Old Value New Value
Status changed New In Progress
dpage commented 7 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/1603#note-9 Originally created by Khushboo Vashi at 2016-10-14 13:35:32 UTC.

The patch submitted.

https://www.postgresql.org/message-id/CAFOhELebFb=ceHh2bhRFE6awSx1LGW9EYaqC7AfkmEaWnPXXig@mail.gmail.com

This fix does not include the special case when database name contains an equal to (=) character in it, because we couldn't figure out the escape character to be used with = character.

dpage commented 7 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/1603#note-10 Originally created by Khushboo Vashi at 2016-10-21 05:17:43 UTC.

The patch submitted

https://www.postgresql.org/message-id/CAFOhELc9QPBgQWDzkmwrV_i9Dzo6O3-3tjZ34-iYJ1nSH-0q%3Dg%40mail.gmail.com

dpage commented 7 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/1603#note-11 Originally created by Khushboo Vashi at 2016-10-21 13:57:23 UTC.

Applied in changeset commit:5a1795e4a0c0c97ebfcc30b207d69a7f142cf169.

Redmine ticket header update:

Name Old Value New Value
Status changed In Progress In Testing
Done Ratio changed 0 90
dpage commented 7 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/1603#note-12 Originally created by Fahar Abbas at 2016-10-24 11:25:43 UTC.

RM is resolved in latest commit ID:

commit c1c2fb9df9f9fb03394bd3941424fa62998b4f55

Tested Platform: Windows 2012 server 64(Python 2.7.11) Ubuntu 16.04 Linux 64(Python 3.5)

Redmine ticket header update:

Name Old Value New Value
Status changed In Testing Resolved
dpage commented 7 years ago

Attachment migrated from Redmine: https://redmine.postgresql.org/attachments/download/1848 Originally created by Fahar Abbas at 2016-10-24 11:29:21 UTC.

https://pgadmin-archive.postgresql.org/redmine/1603/1848-Screen_Shot_2016-10-24_at_4.28.07_PM.png

dpage commented 7 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/1603#note-14 Originally created by Fahar Abbas at 2016-10-24 11:29:29 UTC.

My Apology to changing the status as resolved this issue is not resolved with export database

Sharing snapshot for a reference.

Redmine ticket header update:

Name Old Value New Value
Attachment added Screen Shot 2016-10-24 at 4.28.07 PM.png
Status changed Resolved New
dpage commented 7 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/1603#note-15 Originally created by Dave Page at 2016-10-27 10:28:10 UTC.

Redmine ticket header update:

Name Old Value New Value
Fixed Version changed 1.1 1.2
dpage commented 7 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/1603#note-16 Originally created by Khushboo Vashi at 2016-11-18 05:44:22 UTC.

Hi,

I am not able to reproduce the issue. Please describe the steps and parameters to reproduce it.

Thanks, Khushboo

Redmine ticket header update:

Name Old Value New Value
Assigned To changed Khushboo Vashi Fahar Abbas
dpage commented 7 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/1603#note-17 Originally created by Fahar Abbas at 2017-02-01 05:04:44 UTC.

Now Changing the status to resolved

Tested Platform: Windows 2012 R2 64(Python 2.7.11)

Commit ID:

commit 0da8d1fe4c62e03157fcbee7b1f626dbae4f140c

Redmine ticket header update:

Name Old Value New Value
Status changed New Resolved
dpage commented 6 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/1603#note-18 Originally created by Fahar Abbas at 2018-01-09 05:03:54 UTC.

Redmine ticket header update:

Name Old Value New Value
Done Ratio changed 90 100
dpage commented 2 years ago

Issue closed on Redmine.