Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvCCn-0002PJ-3x for pgadmin-hackers@arkaria.postgresql.org; Fri, 14 Oct 2016 23:48:01 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bvCCm-0002ei-8D for pgadmin-hackers@arkaria.postgresql.org; Fri, 14 Oct 2016 23:48:00 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bvCCX-0002Py-Ds for pgadmin-hackers@postgresql.org; Fri, 14 Oct 2016 23:47:45 +0000 Received: from mail-it0-x231.google.com ([2607:f8b0:4001:c0b::231]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bvCC9-0007la-1n for pgadmin-hackers@postgresql.org; Fri, 14 Oct 2016 23:47:42 +0000 Received: by mail-it0-x231.google.com with SMTP id l13so4807337itl.1 for ; Fri, 14 Oct 2016 16:47:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pgadmin-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=nf19PXaRK6lsIDBDkPi0hAgGnKX3yWPynabZExnKiW4=; b=vp+6ZuCN8Q4fVV4qty0m/1pyEM1UN7zwvdmT2nbz3n2TYMS1SFD9ML/3ukXAWmWbi1 0Yot5juaCWg1+UaX4oGMMkLlR66exAL0vxspIFFAd4EwcF5+ZovXRuyQ2GCM6NE7TDeq 3IGmSsxR+vmlfQ8+1+IPgBZMjxfyXgJ09n66CxuiKj4OEDcoOtmlQ64GgaEVmCq5+E/5 kF4teJiQzJywxCcZPRbl8nFpFtnJPMlqFHcgaHtl4j/7vr1hJxMxk3ksxu2Fe1VrPOlC bMFF1yKpyEtWxFX6EyQwQtkTLKljnt+rBrXZBb1tJWeNGTNm/Mu2vSJpDueKjSUIQlBl LUGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=nf19PXaRK6lsIDBDkPi0hAgGnKX3yWPynabZExnKiW4=; b=SCfRnxUaTK/76kX4OSltnDxmCU8WmH+xuc0VH6A9p1cZx/BZVMG2n/YnmOcLQwGeUy LQcfXEbtkh+r6hsW11b2oy2FQgJRdX7CDDTrLRBC5+h8r/mFwoWAZ5aRjERl2yaglzqe rm1eUsXqukuzOp0FmewDjo/lzDU7R8RWudrVtp4qNZAzxXgOEJOoJIFcKjlSoY/EA13H lZQtnUj3g/RkRMa6a1srLjcyk81zN13gSu4HiDjBxCysLpn3d/TRjSLAPqxj9k8biLr0 CRwsIWWbDJLXgw4xxYx+RIxldi8KtU6wmevG0wA6KcftEOXXNg/omaDJbXpyxktc6Ndx jb4Q== X-Gm-Message-State: AA6/9RmEw/ZYRzuf15loE4bUXXl27D4x5QK42SyJXfUAfWpJMSkd1wvzzDQwTrh92AKX64DAZWOOpvMSp36ULg== X-Received: by 10.36.202.131 with SMTP id k125mr630249itg.100.1476488839847; Fri, 14 Oct 2016 16:47:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.146.135 with HTTP; Fri, 14 Oct 2016 16:47:19 -0700 (PDT) In-Reply-To: References: From: Dave Page Date: Sat, 15 Oct 2016 00:47:19 +0100 Message-ID: Subject: Re: [pgAdmin4][Patch]: Fixed RM 1603 & RM 1220 To: Khushboo Vashi Cc: pgadmin-hackers Content-Type: multipart/alternative; boundary=94eb2c089e5cd0714d053edbd89e X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgadmin-hackers Precedence: bulk Sender: pgadmin-hackers-owner@postgresql.org --94eb2c089e5cd0714d053edbd89e Content-Type: text/plain; charset=UTF-8 On Friday, October 14, 2016, Dave Page wrote: > Hi > > On Friday, October 14, 2016, Khushboo Vashi com > > wrote: > >> Hi, >> >> Please find the attached patch to fix the below 2 bugs. >> >> RM 1603: [Web Based] Export database failed if object contains double >> quotes. >> RM 1220: Backup database is not working with special characters >> >> The issues which were fixed: >> >> 1. Client side data were not unescaped >> 2. Required command line arguments were quoted twice >> > > This is not working for me: I tested using Table Export as per Fahar's > instructions. As I'm in desktop mode, the first problem was that we get an > error at line 210 of import_export/__init__.py, because > get_server_directory returned None for the directory. If I fix that, then > the job says it's created, but as far as I can see, nothing else happens. > Oh, oh, oh - 30 minutes later I restarted pgAdmin and got a failed job message! Copying table data 'q m g r o c k s.q m g r o c k s ' on database 'q m g r o c k s' for the server - 'EPAS 9.5 (172.16.254.22:5444)' Running command: /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 'Users/dpage/foo.csv' DELIMITER ';' CSV QUOTE '"' ESCAPE '''';" Start time: Fri Oct 14 2016 16:21:06 GMT-0700 (PDT) Users/dpage/foo.csv: No such file or directory Looks like it lost the leading / on the path, so that might have been my hacky fix for the first issue. > Secondly, this patch seems to push quoting responsibilty to the front end. > This doesn't seem right, because we might want to use the RESTful APIs for > another purpose in the future, which would mean needing to re-implement > quoting if something else uses an affected API. > > Thanks. > > > -- > Dave Page > Blog: http://pgsnake.blogspot.com > Twitter: @pgsnake > > EnterpriseDB UK: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > > -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company --94eb2c089e5cd0714d053edbd89e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On Friday, October 14, 2016, Dave Page <dpage@pgadmin.org> wrote:
Hi

On Friday, October 14, 2016, Khushboo Vashi <khushboo.vashi@enterprisedb.com> wrote:<= br>
Hi,

P= lease find the attached patch to fix the below 2 bugs.

=
RM 1603:=C2=A0[Web Based] Export database failed if object contains do= uble quotes.
RM=C2=A01220: Backup database is not working with sp= ecial characters

The issues which were fixed:

1. Client side data were not unescaped
2. Re= quired command line arguments were quoted twice=C2=A0

This is not working for me: I tested using Table Exp= ort as per Fahar's instructions. As I'm in desktop mode, the first = problem was that we get an error at line 210 of import_export/__init__.py, = because get_server_directory returned None for the directory. If I fix that= , then the job says it's created, but as far as I can see, nothing else= happens.=C2=A0

Oh, oh, oh - 30 minut= es later I restarted pgAdmin and got a failed job message!

Copying table data 'q m g r o c k s.q m g r o c k s ' on d= atabase 'q m g r o c k s' for the server - 'EPAS 9.5 (172.16.254.22:5444)'
Runni= ng command:
/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 = 9;Users/dpage/foo.csv' DELIMITER ';' CSV QUOTE '"'= ESCAPE '''';"

Start time: Fr= i Oct 14 2016 16:21:06 GMT-0700 (PDT)
Users/dpage/foo.csv: No suc= h file or directory=C2=A0


Looks lik= e it lost the leading / on the path, so that might have been my hacky fix f= or the first issue.


Secondly, this patch seems to push quoting responsibilty to= the front end. This doesn't seem right, because we might want to use t= he RESTful APIs for another purpose in the future, which would mean needing= to re-implement quoting if something else uses an affected API.
=
Thanks.


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

EnterpriseDB UK:
http://www.enterprisedb.com
The Enterp= rise PostgreSQL Company



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

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

--94eb2c089e5cd0714d053edbd89e--